How can I set my MediaElement (Silverlight) to play an audio file when it has some data (for example 10 % of the streamed file) ?
I want to start playback immediately after a little portion has buffered, then, if the application had no data, just pause the playback and wait. Is this possible?
Thanks in advance,
Regards
I think this is supported by the MediaElement. You just have to specify thru one of its properties whether it should Begin automatically.
Related
I set my audio clip to loop (by checking off the loop checkbox in the audio source) however, after about an hour the audio stops playing. How do I fix this? Is there code that I have to add to the script?
Apparently the loop function is not indefinite.. not too sure about this.
Thank you!!
If your sound file is an .mp3, try changing it to an .ogg file. Unity seems to have some problems with .mp3.
Also, it could be simply be a lack of computing resources to run in play mode that long. Try building your application and seeing if the error still occurs.
I'm currently recording an RTSP stream using the FFMPEG libaries (essentially recording in 1 minute video files). Everything is working well, with the exception that if I launch the video files, the player views them as streams, not as videos (so seeking is disabled, etc.).
I suspect I need to set the proper option when I am using avformat_write_header(output_context, NULL) instead of giving no options.
I've discovered the list of options in libavformat/options_table.h but none of them seem to apply. As an example of how I'm thinking I need to solve this, I've looked at https://ffmpeg.org/pipermail/libav-user/2013-January/003541.html and I see things like "sample_rate", "pixel_format" etc. that could be set. Is there something to set the metadata in the file I'm writing from an RTSP stream to behave as a video instead of a stream when I play it after the fact? Or if it isn't written with the header, is there some other way I can do this?
Seems like the issue is related to the specific video player being used, which makes me believe its not related to the meta data but how the player is interpreting the video stream.
If it does turn out that I can explicitly set this using the FFMPEG libraries I'll mark that as the accepted answer.
Hey all I want to play a sound. I issue a c command and it plays the sound, then the user presses a key, let's say "h" and then the sound stops for 5 seconds, and returns after 5 seconds. What c command can i use to do this? I thought mci send string might work, but I'm not sure.
Play Sound was my go to but it doesn't have this functionality.
any code suggestions?
I assume you are using Windows
Use the waveOutPause() to pause the audio.
Use Sleep(5000);
Use the waveOutRestart() to start the audio from where it paused.
See also: waveOutPause MSDN documentation
I am haaving some problem with a loop in a Html5 game.
I have a sound ( 4-5sec) that I wanted to play with a loop.
But between each loop I can hear the sound stop (for 0.5sec) and replay.
I read that "MP3 has a 0,25 seconds piece of silence at the start of the audio file.",
and tried this:
start loop and sound for every sample at T = 0,25, so there were a preloading of all of the audio file, but play and loop after 0,25 seconds."
However, the delay is still present for mp3 ogg, or wave, (Firefox and chrome)
Can someone help me find a solution?
As we all know we can have /dev/video0 as a directory for receiving the output of a webcam.
Is it possible to create a fake /dev/something directory through a C program and continuously output there the contents of some created png files in order to create a fake webcam for example?
I will then read the live stream for an other application.
Thanks.
If all you need is a place in the filesystem where some application can read some specific data, use mkfifo to create it.
Then you can write a producer that writes whatever you need at whatever bitrate to it and have a consumer reading from it. If you output what the consumer expects, you might be able to get something that resembles a "live stream" of faked data.