Menu

Trouble importing WAV files

wes adam
2018-06-23
2018-06-25
  • wes adam

    wes adam - 2018-06-23

    Having trouble importing WAV files into gnaural java on mac. Tried "n" to create new voice as well as loading a scheduled file but can't seem to get an import of wav file. I made sure it is formatted at 44,100. Trying to add some sounds over beats. Any help appreciated, thanks!!

     
  • gnaural

    gnaural - 2018-06-25

    Hi. Hopefully it's just a path or bit-rate issue (the WAV files need to be 16-bit). Or simplest of all: Maybe you didn't hit "Enter" (or Mac equivalent) on your keyboard after entering filename in the Description field.

    Best thing to try is starting Gnaural in a terminal window, to see debugging info. To start it in a terminal, simply type:
    java -jar GnauralJava.jar

    If audio file and path typed in "Description" field are valid, you'll see something like:

    Looking for WAV file: Bells.wav
    Audio Format: PCM_SIGNED 44100.0 Hz, 16 bit, mono, 2 bytes/frame, little-endian
    bytes: 4169588
    Converting 44100/1/16 to 44100/2/16 bytes:8339176
    Got WAV file "/tmp/Bells.wav"
    

    When I deliberately put the wrong filename in there, it spits out:

    Looking for WAV file: Bellys.wav
     Not there, trying again at: /tmp/Bellys.wav
    Audio file load failed, you sure this is a WAV file?:
    Bellys.wav
    

    If that's not the problem, test the approach with a truly vanilla WAV file; I just now tested this random free sample, worked fine on both Windows and Linux:
    http://www.music.helsinki.fi/tmt/opetus/uusmedia/esim/a2002011001-e02.wav

    Looking for WAV file: /tmp/a2002011001-e02.wav
    Audio Format: PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, little-endian
    bytes: 9580548
    Got WAV file "/tmp/a2002011001-e02.wav"
    

    If that doesn't do it, here's some more info: Gnaural can handle mono or stereo fine, but putting metadata in the WAV file (like Audacity tries to do during the Save process, i.e., offering text boxes for "Description", etc.) can cause a read fail if you don't leave everything blank. If this is the problem, Audacity would also be "the cure" (i.e., Audacity can "erase" metadata too via the Save dialog).

    I don't have a Mac to test on, but in general, Linux (what I use) and Mac have identical UNIX-style path formats; indeed, Windows is the special-case, byt re-testing WAV functionality just now on a windows machine, with backslashes and even unnecessary drive letter (i.e., "C:\Users\gnaural\Downloads\Bells.wav"), works fine. Using odd characters in the filename (even spaces) can be a problem; in general, you'd want to avoid anything but letters and numbers anyway, to keep whatever you save fully multi-platform.

    Handling audio files is definitely a weakness in Java's native libs, unfortunately.

     

Log in to post a comment.