Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot play WAV files #23

Open
Landiie opened this issue Mar 16, 2024 · 3 comments
Open

Cannot play WAV files #23

Landiie opened this issue Mar 16, 2024 · 3 comments

Comments

@Landiie
Copy link

Landiie commented Mar 16, 2024

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!

@stsaz
Copy link
Owner

stsaz commented Mar 16, 2024

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/)

@Landiie
Copy link
Author

Landiie commented Mar 16, 2024

  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!

@stsaz
Copy link
Owner

stsaz commented Mar 16, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants