Thursday, 15 May 2014

ffmpeg - How to synchronise two audio files using a marker -



ffmpeg - How to synchronise two audio files using a marker -

i'm working on project on utilize webrtc , recordrtc library record sound files.

i able process sound files server-side ensure synchronisation.

to so, i'm thinking marking start of each record inaudible sound marker in order analyse new records , manipulate starting offset ffmpeg (which utilize compress raw files created recordrtc).

the thing i've never done advanced sound processing before, i'm looking around , cannot find proper way this.

is there another, better, way handle synchronisation? , if not, grateful if tips on marker technique. give thanks you.

edit: forgot mention don't know how recordrtc works record done client-side in javascript. synchronisation issue comes fact javascript not @ synchronising calls.

the process done follow:

1) user records himself

[user 1] -> records on browser sound file | | saves raw sound file (call audio_1.ogg) | [server]

2) user wants bring together user_1's project

[user 2] <--- fetch audio_1.ogg (in sound html tag) --- [server] | | press record | [webapp] -> plays audio_1.ogg , starts recording audio_2.ogg | | saves audio_2.ogg when record on | [server]

the synchronisation issue comes fact there no way in javascript ensure both functions handling starts record , 1 responsible origin playing existing sound file happen on same time.

i end ~50/100 ms of gap depending on how many sound files on project (since it's not limited two).

you should utilize --enable-exclusive-audio flag remove such kind of approx-100ms delay on windows.

you can use ffmpeg-commands remove latency:

ffmpeg -i audio-file.wav -itsoffset -00:00:01 -i video-file.webm -map 0:0 -map 1:0 output-file-name.webm

recordrtc has how prepare audio/video sync issues on chrome? section:

recordaudio = recordrtc( stream, { onaudioprocessstarted: function( ) { recordvideo.startrecording(); } }); recordvideo = recordrtc(stream, { type: 'video' }); recordaudio.startrecording(); updated:

ah, forgot reply actual question:

ffmpeg -i audio-1.wav -itsoffset -00:00:01 -i audio-2.wav -map 0:0 -map 1:0 output.wav

ffmpeg html5-audio webrtc audio-processing voice-recording

No comments:

Post a Comment