diff options
Diffstat (limited to 'examples/allatency.c')
-rw-r--r-- | examples/allatency.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/examples/allatency.c b/examples/allatency.c index 7ece01eb..5aa9e864 100644 --- a/examples/allatency.c +++ b/examples/allatency.c @@ -79,11 +79,22 @@ static ALuint LoadSound(const char *filename) } /* Get the sound format, and figure out the OpenAL format */ + format = AL_NONE; if(sfinfo.channels == 1) format = AL_FORMAT_MONO16; else if(sfinfo.channels == 2) format = AL_FORMAT_STEREO16; - else + else if(sfinfo.channels == 3) + { + if(sf_command(sndfile, SFC_WAVEX_GET_AMBISONIC, NULL, 0) == SF_AMBISONIC_B_FORMAT) + format = AL_FORMAT_BFORMAT2D_16; + } + else if(sfinfo.channels == 4) + { + if(sf_command(sndfile, SFC_WAVEX_GET_AMBISONIC, NULL, 0) == SF_AMBISONIC_B_FORMAT) + format = AL_FORMAT_BFORMAT3D_16; + } + if(!format) { fprintf(stderr, "Unsupported channel count: %d\n", sfinfo.channels); sf_close(sndfile); |