Ogg stream stops and errors appear in console

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By imekon
:warning: Old Version Published before Godot 3 was released.

I’m playing some music with Godot V2.1.4.stable.official and after about a minute, the music stops and I see the following appear in the console:

ERROR: AudioStreamPlaybackOGGVorbis::set_file: Condition ' err ' is true. returned: err
   At: modules\vorbis\audio_stream_ogg_vorbis.cpp:250
ERROR: AudioRBResampler::setup: Condition ' p_channels != 1 && p_channels != 2 && p_channels != 4 && p_channels != 6 ' is true. returned: ERR_INVALID_PARAMETER
   At: servers\audio\audio_rb_resampler.cpp:275
ERROR: AudioStreamPlaybackOGGVorbis::_load_stream: Condition ' !stream_valid ' is true. returned: ERR_UNCONFIGURED
   At: modules\vorbis\audio_stream_ogg_vorbis.cpp:292
ERROR: AudioStreamPlaybackOGGVorbis::set_file: Condition ' err ' is true. returned: err
   At: modules\vorbis\audio_stream_ogg_vorbis.cpp:250
ERROR: AudioRBResampler::setup: Condition ' p_channels != 1 && p_channels != 2 && p_channels != 4 && p_channels != 6 ' is true. returned: ERR_INVALID_PARAMETER
   At: servers\audio\audio_rb_resampler.cpp:275
ERROR: AudioStreamPlaybackOGGVorbis::_load_stream: Condition ' !stream_valid ' is true. returned: ERR_UNCONFIGURED
   At: modules\vorbis\audio_stream_ogg_vorbis.cpp:292

it looks as though there’s corruption in the stream? I am playing one chunk of Ogg after each other, using the finished signal to play the next piece. Should I try using loop points in Ogg instead (if they exist?)

Do you have a simple repro project? If you do that could be useful to report on Github as a bug (and otherwise it’s difficult to tell what’s going on, if it’s really a bug or a misuse)

Zylann | 2018-01-08 13:57

Working on that. I have found it appears to work in godot V3 beta 2. It also appears to die when the first stream stops and I try to start the next stream in V2.1.4

EDIT: Actually it’s worse in 3 beta 2 - it simply plays the intro part again and no error is logged that the next part isn’t playing.

imekon | 2018-01-09 07:14

And today, I built a version for the musician who created the music to use - it worked just fine.

I added some more music he created, it works fine in the godot IDE… but the exported version generates the error mentioned about.

It seems the Stream Player is unstable? I can’t get consistent results?

All that I’m doing is:

streamPlayer.set_stream(oggVorbisStream)
streamPlayer.play()

To play the next piece, I have a func processing the finished signal from the StreamPlayer:

streamPlayer.set_stream(oggVorbisLoopingStream)
streamPlayer.play()

Yet this is giving inconsistant results - a: only plays first part, b: plays all of it, c: simply refuses to start.

imekon | 2018-01-10 14:11

:bust_in_silhouette: Reply From: imekon

It’s the same problem as here:

https://forum.godotengine.org/11389/ogg-file-not-playing-on-export-but-plays-fine-in-godot?show=11389#q11389

File names are case sensitive. In the IDE on Windows, I’m guessing they’re not. In a packaged resource file, I guess they are.