I'm making a downloader using C#, I want to add a feature of Pause & Resume download, I googled & implemented the suggestions but it didn't work for me; was resuming from the correct position but had problem merging with the downloaded part. I tested it by downloading a video file but after pausing the download & starting it again the result file played for while (it played the portion which it downloaded before pausing but not the portion after pausing).
How can i merge the 2 portions successfully.
We can't figure out what's wrong with your code, because we can't see your code (it's not always enough to post the source using which you made your own code).
Either way, you can try this: Create a file with some easy to spot bit pattern (like 0101010101010101...) using some hex-editor, and try to see where it breaks.
If, for instance, the second part of the download keeps running over the few last bits of the first part, that would give you some clue.
Related
I am trying to recreate some features of Spotify in C# using the PostgreSQL database.
The reason is simple, I want to gain more knowledge, and I think this is a good challenge.
But I ran into an obstacle that I've been standing for days. Spotify he doesn't download the music, he does her streaming, plays the music while it's downloaded.
However, I can't do this in C#, I'm using the PostgreSQL database.
I'm well locked in this part, I tried several implementations, but I think I'm not on the right track, and on the internet I imagine I'm looking wrong, otherwise I would have found it.
Do you have any guidance for this streaming process in C#? I've tried to read the large_object bytes from PostgreSQL, but couldn't.
Any suggestions or guides about the process are welcome.
You start by getting the file into the database or its network location into the database, whichever gives you better performance; Then start with creating an implementation of a bytestream. You want to be transmitting raw data to c#.
you then build a real time interpreter that takes in using your file format, one byte at a time, and plays the value associated with that section. does that make sense? this is simple to do with many libraries and the brunt of it is just figuring those out.
You seem like you've PROBABLY got that first part down, and are instead having issues with the database. A lot of things we did at my last company involved saving file network locations and indexing files on disk. You might be able to instead point your streamer to a file locally using a server, and instead transmit data from one point to another in that manner instead.
You seem more than capable of doing this just judging by your speech. I hope this comment was helpful, and if it was not I apologize as well. I would be interested in seeing your finished result.
for clarification here would be that workflow:
request for a song listed in table dbo.Songs
matches that song onto dbo.songlocation
streams from dbo.songlocation.location from the filename dbo.songlocation.songname = dbo.song.name and verified directory returns true
enjoyment of that music
For last 2-3 weeks i am looking for a reason behind my problem. But unfortunately i could not found anything needed.
It is a Windows Phone Book reader application i am creating using c# and xaml .
For that i need to download book file from the web service and extract and save audio,image and html data from it. All data are stored in local folder.
The main functionality is that we can see highlighting of texts with the corresponding audio plays. And the high lighting functionality is done by java script function.
My problem is that the highlighting text is delaying some times and it doesn't meet with it's audio. And this is happening on the session where the book data downloaded from network or where download operation took place.
Is there anything related to network download operation can
prevent/delay the execution of java script function ?
Can network download operation makes any impact on Web browser control
?
If you use callback functions in JS the right way the function of eg. highlighting will start only after the loading is complete. This issue reminds me of a few things I have seen while toying with nodeJS that uses about 80% async functions and a loop. However, if you want to get things structured in JS you might want to have a look at RequireJS, but async func calls can be used anyways..
function highlightElement(element, function(){
// Load document here, once this operation is done, highlighting will start
}) {
element.addClass('active');
};
I'm new to using Directshow. I'm more than willing to post the pages of code I've writen but I'm hoping someone could explain or hint in the right direction for a solution so I can figure it out myself.
Basically I have a WPF program that displays a window that has a preview of my webcam - this is done and working. Now I'm trying to get it to record the preview - done using graphBuilder.SetOutputFileName
However everytime I show the window to record another session is just overwrites the last file it recorded, even though I'm calling graphBuilder.SetOutputFileName again!
So my question is how can I change the outputfilename to record a second video. I know I'm missing something but don't know what.
Thanks in advance.
Rich
Filter graphs normally create media files starting from scratch on your initial Run and closing the file on your Stop. Next time you repeat the calls, you just start it from fresh from empty (overwritten) file. There is no appending. If you want to keep the previously recorded content, you need to switch files by providing new name, or copying/renaming the completed file.
hi i am following this link
http://www.codeproject.com/KB/directx/directxcapture.aspx
to capture data from webcam.Its working fine but when i pause and do resume then the file that contains data, its size increases but old data is lost and only new data persists.
can anybody point me towards a working example/tutorial where pause feature works.
i tried/searched many links but still landed nowhere.
can anybody provide me some help!!!
There are a number of comments about this in the article:
Searching "pause" inside the article comments
All search results for "pause" in the article comments
I tried the pause behavior of directShow.net but somehow it did not worked.
when i paused a avi file was created and when i resumed i found that the new contents are written on the previous file. the size of the file increased but the older content was washed away.
So i tried this:
1) When i paused a file say test.avi was generated.
2) when i resumed i renamed test to test1.avi and created new test.avi
file and merged them when user clicks on stop.
In this way i achieved pause feature. though its indirect but its still working for me..
hope i could implement the direct way.
Can I move more than 1 file at the same time? Right now, I move one file, then if this is successful move another....with delegates and all. I was wondering if there was a simpler way to do this.
This lib lacks examples. I constantly find weird little things in my app that end up being hiccups; and I am not sure whether it is my code or the lib.
Like this issue - it makes logging into my app VERY VERY slow (40 seconds), just because I am getting 2 files upon login.
Any ideas?
FTP itself doesn't allow multiple file moves, so there's no way for any library to do more than one. See the RFC, section 4.1.3.