phiola icon indicating copy to clipboard operation
phiola copied to clipboard

Cannot play WAV files

Open Landiie opened this issue 1 year ago • 3 comments

trying to use wav files and i can't get them to work no matter what using phiola. Plays in any other media player just fine, so I'm unsure what could be going on. I am running these through the CLI.

The first file I tried is 353kbps, int16, 22050Hz mono, no dice

then the second file i tried, something more modern, 2822kbps int32 44100Hz stereo, also wouldn't work.

Both files output the same error: 01:27:11.720 #25968 ERROR wasapi: *1: open(): unsupported format

cmd_NUK25nhlfX

Any help would be massively appreciated!

Landiie avatar Mar 16 '24 01:03 Landiie

Hi! Looks like phiola can't get the audio format that is set by default in your Windows audio settings. Let's find out why is that. Here are a few options:

  1. Execute phiola -D ....wav | findstr wasapi: This will print several lines to you terminal. Please paste here the line wasapi: *1: opening device ....
  2. Execute phiola -D ....wav -exclusive | findstr wasapi: It's the same but now trying to open the audio device exclusively.
  3. What's the default format for your audio device? Try to set another format. (See https://integraudio.com/default-audio-format-windows-10/)

stsaz avatar Mar 16 '24 07:03 stsaz

  1. Lines + Error
08:40:52.738 #3272 DEBUG  wasapi: *1: opening device #0, int16/22050/1, flags:80
08:40:53.576 #3272 DEBUG  wasapi: *1: opening device #0, float32/48000/8, flags:80
08:40:54.112 #3272 ERROR  wasapi: *1: open(): unsupported format
  1. No change running -exclusive, same output as above

  2. My Default Format is "8 channel, 16 bit, 480000 Hz", which I believe is unique to my corsair headset. Setting it to any of the other available formats in 2 channel mode makes it work just fine.

Something I will note: Now, with the channel change, I can play all of the wav files, however, any sounds with a different Hertz from my Default Format have a considerable delay compared to the other formats. a little over half a second!

Landiie avatar Mar 16 '24 08:03 Landiie

in 2 channel mode makes it work just fine.

Interesting! I think your audio device doesn't support float32/48000/8 that phiola is trying to use but supports int16/48000/8. This is surprising to me because WASAPI should convert float32->int16 internally, and phiola relies on this behaviour. We can test this theory:

  1. Change your default format back to int16/48000/8 as it was before.
  2. Convert your audio file:

phiola convert ....wav -o test.wav -af int16 -chan 8 -ra 48000

  1. Now try to play the new file: phiola -D test.wav | findstr wasapi:

  2. It should print opening device #0, int16/48000/8 and then play audio just fine.

stsaz avatar Mar 16 '24 13:03 stsaz