views:

127

answers:

2

Hi, I would like know if it is possible to create embedding of audio message to audio files?

For example, on playing every 10 sec of an audio, it would be interrupted with an audio message "You are currently listening to an audio by XYZ band" and then the audio continues. And even if someone were to download the mp3 file, the audio message is still embedded with that downloaded file?

May I know if there are any libraries or classes that can work with php to achieve the above result? And what would be the workflow?

Thank you very much.

A: 

This reminds me of the Groove Salad radio station; they occasionally put such interruptions into their audio stream.

I don't know if this is possible, but with the MP3 format I would guess the answer is no; especially when you want your audio message to be in-audible for regular listening. It's probably possible to put some alternative audio stream into the MP3, similar to adding a ID3 tag (which can also contain album cover art), but if you want other people to be able to decode your alternative audio stream, you'd have to stick to a common standard of doing this. I wouldn't know of any.

Things might look different with other formats (e.g. the Windows WAV file format) which allow the storage of custom data besides the actual audio stream.

stakx
I think he wants to mix the interruptions in permanently.
Pekka
If regular listening isn't possible, then I think I would opt for permanent mix then.
jl
+1  A: 

You definitely can't do that in pure PHP - in theory you could write a MP3 decoding and encoding engine for PHP but it's an insane idea - and you will need some server side help for the task.

ffmpeg should enable you to mix multiple MP3s together to one file, provided your host supports it.

Pekka
Thanks, I will check it out.
jl
Can ffmpeg merge/mix the 2 audio files it on every 10 sec loop?Alternative to ffmpeg, Sox can do it too? sox -m audio1.mp3 audio2.mp3 output.mp3
jl