|
General software and network General OS-independent software and network questions, X11, MTA, routing, etc. |
|
Thread Tools | Display Modes |
|
|||
.wav file playing very fast on unix, fine on win
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: Code:
Audio file file format detected. ========================================================================== Opening audio decoder: [pcm] Uncompressed PCM audio decoder AUDIO: 8000 Hz, 1 ch, s16le, 128.0 kbit/100.00% (ratio: 16000->16000) Selected audio codec: [pcm] afm: pcm (Uncompressed PCM) ========================================================================== ao2: 8000 Hz 1 chans s16le [0x9] AO: [sun] 8000Hz 1ch s16be (2 bytes per sample) Video: no video Starting playback... |
|
|||
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. Thanks a lot |
|
||||
Quote:
|
|
||||
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. Last edited by BSDKaffee; 1st June 2009 at 11:41 AM. |
|
|||
Code:
mplayer -ao oss Code:
mplayer -speed 0.1 -srate 8000 -ao pcm:file=somefile-resampled.wav somefile.wav Before posting I did try to convert the file to mp3 with lame, but with no good results. I downloaded the file, and has the exact behaviour of my on files. Quote:
Code:
$ mixerctl outputs.select=headphones outputs.master=0,0 record.source= record.record=0,0 |
|
|||
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 Any one is patient enough to tell me what this "rate" consists of? |
|
|||
how silly, I just changed this
$ mplayer -speed 0.1 -srate 8000 -ao pcm:file=somefile-resampled.wav somefile.wav to this: $ mplayer -speed 0.1 -srate 44100 -ao pcm:file=somefile-resampled.wav somefile.wav and it's fine Thanks a lot ps. it works also without the -speed option $ mplayer -srate 44100 -ao pcm:file=somefile-resampled.wav somefile.wav so, once again, what does this "rate" exactly do? |
|
||||
-srate is sample rate:
http://en.wikipedia.org/wiki/Sample_rate
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
|
|||
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:
|
|
||||
Quote:
I also found an older somewhat relevant thread on the openbsd-ppc mailing list pertaining to this: http://archive.netbsd.se/?ml=openbsd...7-11&t=5745835. Depending on which driver is used, it appears resampling might be the best option. |
|
|||
Quote:
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 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. |
|
|||
if it is of any help, this is the audioctl output:
Code:
$ audioctl -a name=AOA version= config=aoa encodings=slinear:16,slinear_be:16,slinear_le:16*,ulinear_be:16*,ulinear_le:16*,mulaw:8*,alaw:8*,slinear:8*,ulinear:8* properties=full_duplex full_duplex=0 fullduplex=0 blocksize=2048 hiwat=8 lowat=1 output_muted=0 monitor_gain=0 mode= play.rate=44100 play.channels=1 play.precision=16 play.encoding=slinear_be play.gain=0 play.balance=32 play.port=0x2 play.avail_ports=0x3 play.seek=0 play.samples=0 play.eof=0 play.pause=0 play.error=0 play.waiting=0 play.open=0 play.active=0 play.buffer_size=32768 record.rate=44100 record.channels=1 record.precision=16 record.encoding=slinear_be record.gain=0 record.balance=32 record.port=0x0 record.avail_ports=0x7 record.seek=0 record.samples=0 record.eof=0 record.pause=0 record.error=0 record.waiting=0 record.open=0 record.active=0 record.buffer_size=32768 record.errors=0 Code:
$ audioctl play.rate=8000 play.rate: -> 44100 |
|
||||
Quote:
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:
Last edited by IdOp; 2nd June 2009 at 03:23 PM. Reason: spelling |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Playing a CD. | maxrussell | FreeBSD General | 2 | 22nd July 2009 07:24 PM |
hard disk: avail 0 capacity 100% is it fine to use it like this? | gosha | General Hardware | 13 | 17th June 2009 03:53 PM |
A Brief History of the BSD Fast Filesystem, Kirk McKusick | ai-danno | Off-Topic | 0 | 9th March 2009 05:59 AM |
Network connection works fine, and then... | snes-addict | OpenBSD General | 8 | 20th October 2008 11:13 PM |
Score a free domain (it will be gone fast) | 18Googol2 | Off-Topic | 8 | 15th August 2008 07:39 AM |