Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12
Hi, I have a question. I need application or library which would allow me to make one audio file from two. One input file will be background music and other ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2012
    Posts
    5

    Question Songify alternative


    Hi,

    I have a question. I need application or library which would allow me to make one audio file from two. One input file will be background music and other will be simple speech. I found simple mix software SOX.

    I need this for online project, so you can offer other ideas how to do that. My idea is to record user voice with flash, send it to server and then call audio editing software. If you have better ideas I will be very happy to hear them.

    Thanks for your answers.
    Lukas

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    Have you looked into some of the more sophisticated sound mixer programs, such as Audacity? They should do this quite easily.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    If you can generate wav files for both sources, you should be able to do it with sox. Here's an example of joining two wavs into a third new wav file, that is a combination of the first two:

    Code:
    wget http://www.fortunecity.com/lavendar/poitier/135/scream.wav
    wget http://members.tripod.com/~smokeyjoes/beerques.wav
    sox beerques.wav scream.wav homer.wav
    file home.wav
    You can usually get lucky and sox will figure out any things that need to be done behind the scenes and do them for you, but if the two wav files have different bit rates or sample rates or what have you, then you may have to diddle with the wav files first.

    In any case, it sounds like you definitely want a solution that would be amenable to scripting, which sox can provide.

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Jan 2012
    Posts
    5
    Audacity is graphical audio editor. I think it would be difficult to call it from php.

    I tried sox, but it only combines two wav's and don't adapts speech file to the backgroud music file.
    here is an example youtube.com/watch?feature=player_detailpage&v=Nsow27_l6IU#t=53 s how it should work.

  6. #5
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    From the Audacity man page:
    Audacity is primarily an interactive, graphical editor, not a batch-processing tool. Whilst there is a basic
    batch processing tool it is experimental and incomplete. If you need to batch-process audio or do simple edits
    from the command line, using sox or ecasound driven by a bash script will be much more powerful than audacity.
    Note the mention of sox and ecasound for scripting audio processing stuff. I'm not familiar with either, but if Sox doesn't work for you, then maybe you should check out ecasound as an alternative. Here is the web site: http://eca.cx/ecasound/
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  7. #6
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by lukasi View Post
    Audacity is graphical audio editor. I think it would be difficult to call it from php.

    I tried sox, but it only combines two wav's and don't adapts speech file to the backgroud music file.
    here is an example youtube.com/watch?feature=player_detailpage&v=Nsow27_l6IU#t=53 s how it should work.
    What you are talking about is rather sophisticated. You are dubbing or mixing two tracks together. I thought you just wanted to concatenate them together. I've only been able to do this using a complex graphical (Windows) app. Sox may be able to do it, but I've never bothered trying.

  8. #7
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,755
    Well, after reading a bunch of stuff on the ecasound web site, it seems that audio mixing is one of its strengths. Definitely, if I were you, then I would check it out PDQ! Let us know if it works for you.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  9. #8
    Just Joined!
    Join Date
    Jan 2012
    Posts
    5
    Quote Originally Posted by Rubberman View Post
    Well, after reading a bunch of stuff on the ecasound web site, it seems that audio mixing is one of its strengths. Definitely, if I were you, then I would check it out PDQ! Let us know if it works for you.
    Thanks for help. I tried to do something with ecasound, but I have not enough knowledge about audio files to do what I need.

    Maybe someone can give me some examples?

  10. #9
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Have you looked at the Ecasound Examples on their webpage?

    Ecasound Examples

  11. #10
    Just Joined!
    Join Date
    Jan 2012
    Posts
    5
    Quote Originally Posted by atreyu View Post
    Have you looked at the Ecasound Examples on their webpage?
    Yes I tried, but I don't have enough knowledge about audio files to do something good.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •