Combine two audio blob recordings - html5-audio

I am using recorder.js to record two audio files on my web page, which then creates recordings as blobs.
Once I have these audio blobs I would then like to combine them both into one track to be played by another html5 audio player.
I've searched the internet but I can't seem to find any documentation on combining two blob files into one.
I've found how to concatenate one blob to the other but I'm wanting to merge the files at the beginning.
i.e. - sound 1 is singing and sound 2 is guitar.

I made a similar attempt using recorder.js and it did not work out for me too. Even after downloading the concatenated audio file, the time duration displayed by the audio player remained as the time duration of the first audio blob, though the whole concatenated audio content was available. So after several changes and hair tearing moments I chose to concatenate using ffmpeg. Here is link to my repository (Audio-Recording-App)

Related

FFmpeg record live stream and make mp4 file closer to now to play at html5 video and should updated quickly

Now I am developing video clipping system with PHP and FFMpeg.
Recording live stream from media server with rtmp protocol.
Let's suppose we are recording football and I want make highlight soon.
so I can see live streams and also able to clip video.
Please help me if anyone have idea.
Reference URL: https://www.youtube.com/watch?v=x61rge3Q3mw
Thank you.
Angel
It's really quite complicated Task.
But I did like this.
Started record from given URL.
Make ts files per minute.(gave file format, easy to converted to mp4)
Concatenate ts files and made it to mp4( It took really small time)
Then I played mp4 files.
Was Awesome.

Is it necessary to convert database of mp3's to ogg and wave to use html audio?

I have thousands of mp3 files in a database and a website that lets people listen to them. I'm using a flash player but want to move to html5 audio player. Does this mean that I need to make ogg and wave versions of all my audio files? What is a good approach to making these files more accessible?
In short, yes you need to support multiple formats. (Assuming you care about decent browser support.)
If you are lacking disk space, don't get a lot of traffic, and don't mind some delay before the data gets to the user, you can convert these on the fly. Just write some code so that on request, it checks the conversion cache to see if you have already converted the file. If not, convert it on the fly (with something like FFMPEG) and write the data to disk at the same time you are writing it to the client.
As Imre pointed out, browser support is changing all the time. Look up what codecs are supported from time to time.

My Sound object is using to much memory and causing my application to crash. How can I empty the first half of the objects data?

I'm currently working on a dynamic MP3 player in AS3. The player will also support continuous (in length) radio streams.
Because my player will include a 'seek' bar, I allow the user to seek through the Sound object's data. Now I know that with a continuous stream, data being stored on the users RAM will never stop, as downloading will never stop on a continuous stream. This means, after a few hours of streaming, allot of RAM is being used by my app. I've tested the app on my own machine, running a very high spec, and the app crashes in my browser. When i say the app crashes, I mean the whole of Flash, meaning I have to restart my browser in order to use Flash again. I know my app is the cause as Flash has never crashed in the past. It only does it when my app has been streaming for 2+ hours.
So what I want to do is only allow the user to cache up to an hours worth of audio. After an hour, I want to clear the first half of the sound objects data, meaning that only the most recent half hours audio is stored and available for seeking.
So I have my stream:
var soundObj:Sound = new Sound();
soundObj.load(new URLRequest('stream.mp3'));
//ect ect
and sound is where the data is stored. So my question: How would I clear the first 30 mins of audio from that object?
Perhaps the Sound class is not meant to reliably play "unlimited" MP3 files, which seems to be your case. It is made to play normal MP3 "songs". Two hours of MP3 sound can easily accumulate to be larger than 200 megabytes of data.
But there is a good solution - use NetConnection and NetStream classes to stream audio instead. There are many tutorials out there. You will also be able to stream your MP3s, just a bit differently - a central server will be involved, which will transcode these MP3s on the fly, delivering it to you in a true "streaming" manner. One of such servers is Adobe Flash Media Server, an overpriced piece of work from Adobe. A lot of free and open-source alternatives exist which will work fine for your purposes - Red5, nginx-rtmp to name a few, that I have tested myself.

Flash (Actionscript 3): Play 2 videos from 1 NetStream?

I'm streaming a video from an Amazon CloudFront RTMP source with
video.attachNetStream(myNetStream);
myNetStream.play(myVideoFileName,0,-1);
and it's working quite well. Now, what I want to do is something like this:
video1.attachNetStream(myNetStream);
video2.attachNetStream(myNetStream);
myNetStream.play(myVideoFileName,0,-1);
This doesn't work as written because only one of the two videos will play at a time for some unknown reason. I want video1 and video2 to play the same video from a single NetStream (to save bandwidth) and remain completely in-sync with each other. How can I accomplish this?
If you are playing an FLV file directly (not streaming it from FMS), you should be able to :
Load the file with URLStream
Wait for sufficient data to start copying the data to a ByteArray object
Create as many NetStream objects as you need and use the appendBytes(bytes) method
I haven't actually tested it, and the logic of appendBytes() needs to be looked at, but theoretically it should work.
Also, it deserves a benchmark. But it's probably better than re-drawing a bitmap copy at the same rate as the video, and keep the two videos in sync.
bitmapData can't be accessed at all because of security restrictions. I'm going with plan B which is playing 2 netstreams, but reducing the file size of the one the videos by removing its audio. I'll have to wait until Amazon allow security policy access to use the bitmapData solution.

Live Audio Streaming to a browser methods, must be very simple

I'm recording a mono audio stream using a PIC at 8-bit 8Khz and streaming it raw to another microprocessor that houses a web server. I'm currently buffering the data and turning it into a wav file that gets played in the browser. What I'd like to be able to do is continuously stream the audio as it's being recorded without putting a lot of encoding overhead on the second processor. I've been searching but most searches turn up just streaming from a stored file, but since the file size isn't known ahead of time I'm not sure how to do this without the overhead of mp3 encoding.
You may find that simply creating a WAV file (or other raw format) that keeps growing will, in most players/browser plugins, cause the file to act as a live stream. This is, I believe, basically how like Ogg streaming and similar works. Because the player begins playing before it is done downloading anyway, it keeps playing and downloading until the end of the file, but the file has no end so it just keeps going.
Vlc media player can stream flv and many other formats.