Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Converting MP3 to WAV

Discussion in 'Android' started by BazLevelUp, Oct 12, 2012.

  1. BazLevelUp

    BazLevelUp

    Joined:
    Jun 27, 2012
    Posts:
    36
    Hi everyone!

    I'm still struggling to get access to the user file on his phone / sdcard in order to read the audio file but that's not the point.

    Let's say I can access to a user audio file (kinda like the winamp app on Google Play), is there anyway I can convert the *.mp3 to a *.wav in order to make some preprocess on it?
    I'm not talking about live processing (like a audio visualizer would) ;)

    I find Mp3Sharp on this topic, but I can't see how I can use it.

    Thank you ! :)
     
  2. BazLevelUp

    BazLevelUp

    Joined:
    Jun 27, 2012
    Posts:
    36
    In this topic it is said that WWW.GetAudioClip() is finaly fix in Unity 4.
    Does that means I can WWW(url) a .mp3 file and then get the raw WAV data using Unity 4?
     
  3. Fenrisul

    Fenrisul

    Joined:
    Jan 2, 2010
    Posts:
    614
    If you can get it into an AudioClip object, then yes you can convert it to a WAV at run time by reading sample and writing out a simple PCM wav file of whatever particular flavor you want as AudioClip will give you a giant float[].
     
  4. Angurvadal

    Angurvadal

    Joined:
    Jul 19, 2013
    Posts:
    10
    Hey,
    Resurrecting some posts, I actually have the same issue and it seems that my giant float[] is full of 0s when I'm using the clip.GetData().
    Any clues ?

    Thanks :)
     
  5. loverainstm

    loverainstm

    Joined:
    Nov 16, 2012
    Posts:
    6
    for mp3 format getdata does not work