hello,
I have some lessons I recorded with a digital recorder. I need to listen to them and I would like to do it on unix, which has become my os for everyday work. The lessons have been converted with a software from their (LG) format, to .wav (software only works on windows, of course). The problem is, the files work perfect on windows (I use jetaudio) but once on unix they go very fast and they are just unusable. I'v tried mplayer, aucat, xmms, all with no avail.
mplayer's output while playing:

hello,
I have some lessons I recorded with a digital recorder. I need to listen to them and I would like to do it on unix, which has become my os for everyday work. The lessons have been converted with a software from their (LG) format, to .wav (software only works on windows, of course). The problem is, the files work perfect on windows (I use jetaudio) but once on unix they go very fast and they are just unusable. I'v tried mplayer, aucat, xmms, all with no avail.
mplayer's output while playing:

Two possibilities. Either you have a problem with the sampling rate in which case you will have to learn how to use your audio beyond basics or
you have a crappy AC97 audio chipset so the serious Unix applications
have a problem with it. Remedy is to have real audio card.

FWIW, this has happened to me on an audio stream before, and I use a Turtle Beach Santa Cruz audio card (which is pretty good). Mine was a one-off, so I listened to that stream on a Windows box. It has not recurred.

Does this happen just for WAV files or do mp3s/ogg/videos/etc work?
Do other WAV files work correctly or is it just these ones you made?

From what I gather so far, this sounds like a driver issue (sampling rate problem). It would help if you tell us what OS and version you are using and tell us what audio hardware you have. Running the audio through an OSS-compatible sound system would probably be the most reliable thing to do. If your OS doesn't use OSS, you can install OSS from: http://www.opensound.com/oss.html. In the meantime as a workaround your could try using the -speed option with mplayer; it has a range from 0.01-100. E.g. the following command will cut the playback rate by half:$mplayer -speed 0.5 myfile.wav
The following will speed up playback x2 and is great for making a new "Alvin and the Chipmunks" album :$mplayer -speed 2 myfile.wav

thank you all
I have OpenBSD on a macmini ppc (g4), the first that came out in 2005. Everything workes just fine with "regular" audio files, that is the copies of my cds, but these files even if converted to mp3 will run fast.
Anyway I used the -speed option in mplayer as suggested by bsdkaffee and it works, but with
-speed 0.1

I would like to understand what the problem is about. Audio is integrated.

thank you all
I have OpenBSD on a macmini ppc (g4), the first that came out in 2005. Everything workes just fine with "regular" audio files, that is the copies of my cds, but these files even if converted to mp3 will run fast.
Anyway I used the -speed option in mplayer as suggested by bsdkaffee and it works, but with
-speed 0.1

I would like to understand what the problem is about. Audio is integrated.

Thanks a lot

Learn about Lame and about audio in general on your hardware platform.

I noticed mplayer was using the sun output driver. First I would try using oss instead:$mplayer -ao oss somefile.wav

Failing that, I would suggest using mplayer to resample the WAV files since they seem to be the problem. Since scaling the playback x0.1 worked, try this:$mplayer -speed 0.1 -srate 8000 -ao pcm:file=somefile-resampled.wav somefile.wav
That will scale back the playback rate and keep the sample rate at 8000Hz and write a new file based on that. If it works, I'm sure you could write a small script to batch convert all of the files. I would try playing one of those new files back on your Windows box and see if it sounds right.

Keep in mind, WAV files behave a little differently than mp3's so an mp3 might be fine while a WAV file may sound messed up. Let's find out whether your files are the culprit or if it is a driver issue. I found a file very similar to the type you have as far as sample rate goes (8000Hz 16bit PCM). It should sound like a normal person talking. Try downloading this audio file and see if it plays correctly: http://www.nch.com.au/acm/8k16bitpcm.wav. If that doesn't sound right, then it probably isn't your files.

well
I've found out what causes the problem. It's this:
AUDIO: 8000 Hz
I've tried playing the file with audacity, and it woks fine. If I reencode it using
Project Rate (Hz) 44100
which I see is the rate of all my mp3 files, then it sounds correct.
Now I have to find out how to do this from the command lline

The conversion software you used on Windows created a broken file, now that you know 44100 Hz is the proper rate.. everything should be fine.

Quote:

Originally Posted by mplayer(1)

-srate <Hz> Selects the output sample rate to be used (of course sound cards have limits on this). If the sample frequency selected is different from that of the current media, the resample or lavcresample audio filter will be inserted into the audio filter layer to compensate for the difference. The type of resampling can be controlled by the -af-adv option. The default is fast resampling that may cause distortion.

The conversion software you used on Windows created a broken file, now that you know 44100 Hz is the proper rate.. everything should be fine.

That doesn't seem to be the case. That file I asked gosha to download and test didn't appear to work properly either and it is 8000 Hz as well. Coming from a digital recorder which I presume is mostly intended for voice, 44100 Hz would be overkill and create much larger files. This sounds to me like a driver problem where the codec may not be able to handle 8000 Hz. 44100 Hz is popular since that is what audio CDs use and subsequently most ripped mp3s. Running the audio through a sound server like esd or arts might also "fix" things.

yeah!
I didn't check when recoded the files, I just checked and, for example, a file went from 58.4 M to 322 M. That's quite too much. I think I'll listen to them with the -speed option

Or, I downloaded arts from the packages but can't really grasp what it is exactly and if it is worth the effort. I tried

Code:

artsplay filename.wav

and it plays fine, but to stop playing I have to kill the artsd process.
Question: would artsd allow me to have volume control?

I have quite a lot of files I would like to convert and be able to listen to anywhere.
How should I resample the files? I've read the man page of mplayer, but the relevant parts (option -af and resample) are a bit cryptic to me.

yeah!
I didn't check when recoded the files, I just checked and, for example, a file went from 58.4 M to 322 M.

Note that (44.1/8) * 58.4 = 322 (approx.).

The idea that the file had originally been sampled at 44.1kHz and had a bad wav header identifying it as 8kHz never made sense to me because it didn't fit the originally described symptom. If such a file were played at the 8kHz instructed by a faulty wav header, then it would sound too slow (think: anti-chipmunk [apologies to David Seville] ) rather than too fast.

Quote:

I have quite a lot of files I would like to convert and be able to listen to anywhere.
How should I resample the files? I've read the man page of mplayer, but the relevant parts (option -af and resample) are a bit cryptic to me.

You could take a look at the sox package (the name stands for SOund eXchange). It is a very useful command-line utility that deals only with sound. I find the option syntax much less cryptic and faster to understand than mplayer. It can convert between audio files of different types, re-sample, play, record and many other things.