Thanks to visit codestin.com
Credit goes to github.com

Skip to content

miniaudio_vorbis.h does not compile as of miniaudio version 0.11.22 #4

@aganm

Description

@aganm

I'm trying to use minivorbis according to the instructions in the file miniaudio_vorbis.h, but I'm getting a ton of compilation errors. I figure this file must be outdated with the latest version of miniaudio. I wish I could solve this myself, I will try to dig some more into it.

Trying to build the most barebones test project: miniaudio + minivorbis + miniaudio_vorbis:

#include "miniaudio.h"
#include "miniaudio_vorbis.h"
#define MINIAUDIO_IMPLEMENTATION
#include "miniaudio.h"
#include "miniaudio_vorbis.h"

int main(){}
In file included from x.c:4:
miniaudio.h: In function ‘ma_decoder_init_memory’:
miniaudio.h:64772:22: warning: implicit declaration of function ‘ma_decoder_init_vorbis_from_memory__internal’; did you mean ‘ma_decoder_init_mp3_from_memory__internal’? [-Wimplicit-function-declaration]
64772 |             result = ma_decoder_init_vorbis_from_memory__internal(pData, dataSize, &config, pDecoder);
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                      ma_decoder_init_mp3_from_memory__internal
miniaudio.h: In function ‘ma_decoder_init_file’:
miniaudio.h:65366:22: warning: implicit declaration of function ‘ma_decoder_init_vorbis_from_file__internal’; did you mean ‘ma_decoder_init_mp3_from_file__internal’? [-Wimplicit-function-declaration]
65366 |             result = ma_decoder_init_vorbis_from_file__internal(pFilePath, &config, pDecoder);
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                      ma_decoder_init_mp3_from_file__internal
miniaudio.h: In function ‘ma_decoder_init_file_w’:
miniaudio.h:65516:22: warning: implicit declaration of function ‘ma_decoder_init_vorbis_from_file_w__internal’; did you mean ‘ma_decoder_init_mp3_from_file_w__internal’? [-Wimplicit-function-declaration]
65516 |             result = ma_decoder_init_vorbis_from_file_w__internal(pFilePath, &config, pDecoder);
      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                      ma_decoder_init_mp3_from_file_w__internal
miniaudio.h: In function ‘ma_engine_init’:
miniaudio.h:75951:17: error: ‘ma_decoding_backend_libvorbis’ undeclared (first use in this function); did you mean ‘ma_decoding_backend_vtable’?
75951 |                 ma_decoding_backend_libvorbis,
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                 ma_decoding_backend_vtable
miniaudio.h:75951:17: note: each undeclared identifier is reported only once for each function it appears in
In file included from x.c:5:
extras/miniaudio_vorbis.h: In function ‘ma_decoder_internal_on_seek_to_pcm_frame__vorbis’:
extras/miniaudio_vorbis.h:42:56: error: ‘ma_decoder’ has no member named ‘pInternalDecoder’
   42 |     OggVorbis_File* pVorbis = (OggVorbis_File*)pDecoder->pInternalDecoder;
      |                                                        ^~
extras/miniaudio_vorbis.h: In function ‘ma_decoder_internal_on_uninit__vorbis’:
extras/miniaudio_vorbis.h:49:56: error: ‘ma_decoder’ has no member named ‘pInternalDecoder’
   49 |     OggVorbis_File* pVorbis = (OggVorbis_File*)pDecoder->pInternalDecoder;
      |                                                        ^~
extras/miniaudio_vorbis.h:52:5: warning: implicit declaration of function ‘ma__free_from_callbacks’; did you mean ‘ma_dr_mp3__free_from_callbacks’? [-Wimplicit-function-declaration]
   52 |     ma__free_from_callbacks(pVorbis, &pDecoder->allocationCallbacks);
      |     ^~~~~~~~~~~~~~~~~~~~~~~
      |     ma_dr_mp3__free_from_callbacks
extras/miniaudio_vorbis.h: In function ‘ma_decoder_internal_on_read_pcm_frames__vorbis’:
extras/miniaudio_vorbis.h:59:56: error: ‘ma_decoder’ has no member named ‘pInternalDecoder’
   59 |     OggVorbis_File* pVorbis = (OggVorbis_File*)pDecoder->pInternalDecoder;
      |                                                        ^~
In file included from miniaudio.h:90843:
extras/miniaudio_vorbis.h:62:23: error: ‘ma_decoder’ has no member named ‘internalFormat’
   62 |     MA_ASSERT(pDecoder->internalFormat == ma_format_f32);
      |                       ^~
extras/miniaudio_vorbis.h:62:5: note: in expansion of macro ‘MA_ASSERT’
   62 |     MA_ASSERT(pDecoder->internalFormat == ma_format_f32);
      |     ^~~~~~~~~
extras/miniaudio_vorbis.h:62:23: error: ‘ma_decoder’ has no member named ‘internalFormat’
   62 |     MA_ASSERT(pDecoder->internalFormat == ma_format_f32);
      |                       ^~
extras/miniaudio_vorbis.h:62:5: note: in expansion of macro ‘MA_ASSERT’
   62 |     MA_ASSERT(pDecoder->internalFormat == ma_format_f32);
      |     ^~~~~~~~~
extras/miniaudio_vorbis.h:66:28: error: ‘ma_decoder’ has no member named ‘internalChannels’
   66 |     int channels = pDecoder->internalChannels;
      |                            ^~
extras/miniaudio_vorbis.h: In function ‘ma_decoder_internal_on_get_length_in_pcm_frames__vorbis’:
extras/miniaudio_vorbis.h:93:56: error: ‘ma_decoder’ has no member named ‘pInternalDecoder’
   93 |     OggVorbis_File* pVorbis = (OggVorbis_File*)pDecoder->pInternalDecoder;
      |                                                        ^~
extras/miniaudio_vorbis.h: In function ‘ma_vorbis_ov_read__internal’:
extras/miniaudio_vorbis.h:101:12: error: too few arguments to function ‘ma_decoder_read_bytes’
  101 |     return ma_decoder_read_bytes(pDecoder, ptr, size*nmemb);
      |            ^~~~~~~~~~~~~~~~~~~~~
miniaudio.h:61153:18: note: declared here
61153 | static ma_result ma_decoder_read_bytes(ma_decoder* pDecoder, void* pBufferOut, size_t bytesToRead, size_t* pBytesRead)
      |                  ^~~~~~~~~~~~~~~~~~~~~
extras/miniaudio_vorbis.h: In function ‘ma_vorbis_ov_tell__internal’:
extras/miniaudio_vorbis.h:123:22: error: ‘ma_decoder’ has no member named ‘readPointerInBytes’; did you mean ‘readPointerInPCMFrames’?
  123 |     return pDecoder->readPointerInBytes;
      |                      ^~~~~~~~~~~~~~~~~~
      |                      readPointerInPCMFrames
extras/miniaudio_vorbis.h: In function ‘ma_decoder_init_vorbis__internal’:
extras/miniaudio_vorbis.h:138:48: warning: implicit declaration of function ‘ma__malloc_from_callbacks’; did you mean ‘ma_dr_mp3__malloc_from_callbacks’? [-Wimplicit-function-declaration]
  138 |     OggVorbis_File* pVorbis = (OggVorbis_File*)ma__malloc_from_callbacks(sizeof(OggVorbis_File), &pDecoder->allocationCallbacks);
      |                                                ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                                ma_dr_mp3__malloc_from_callbacks
extras/miniaudio_vorbis.h:138:31: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  138 |     OggVorbis_File* pVorbis = (OggVorbis_File*)ma__malloc_from_callbacks(sizeof(OggVorbis_File), &pDecoder->allocationCallbacks);
      |                               ^
extras/miniaudio_vorbis.h:162:13: error: ‘ma_decoder’ has no member named ‘onReadPCMFrames’
  162 |     pDecoder->onReadPCMFrames        = ma_decoder_internal_on_read_pcm_frames__vorbis;
      |             ^~
extras/miniaudio_vorbis.h:163:13: error: ‘ma_decoder’ has no member named ‘onSeekToPCMFrame’
  163 |     pDecoder->onSeekToPCMFrame       = ma_decoder_internal_on_seek_to_pcm_frame__vorbis;
      |             ^~
extras/miniaudio_vorbis.h:164:13: error: ‘ma_decoder’ has no member named ‘onUninit’
  164 |     pDecoder->onUninit               = ma_decoder_internal_on_uninit__vorbis;
      |             ^~
extras/miniaudio_vorbis.h:165:13: error: ‘ma_decoder’ has no member named ‘onGetLengthInPCMFrames’
  165 |     pDecoder->onGetLengthInPCMFrames = ma_decoder_internal_on_get_length_in_pcm_frames__vorbis;
      |             ^~
extras/miniaudio_vorbis.h:166:13: error: ‘ma_decoder’ has no member named ‘pInternalDecoder’
  166 |     pDecoder->pInternalDecoder       = pVorbis;
      |             ^~
extras/miniaudio_vorbis.h:169:13: error: ‘ma_decoder’ has no member named ‘internalFormat’
  169 |     pDecoder->internalFormat     = ma_format_f32;
      |             ^~
extras/miniaudio_vorbis.h:170:13: error: ‘ma_decoder’ has no member named ‘internalChannels’
  170 |     pDecoder->internalChannels   = vorbisInfo->channels;
      |             ^~
extras/miniaudio_vorbis.h:171:13: error: ‘ma_decoder’ has no member named ‘internalSampleRate’
  171 |     pDecoder->internalSampleRate = vorbisInfo->rate;
      |             ^~
extras/miniaudio_vorbis.h:172:5: warning: implicit declaration of function ‘ma_get_standard_channel_map’ [-Wimplicit-function-declaration]
  172 |     ma_get_standard_channel_map(ma_standard_channel_map_vorbis, pDecoder->internalChannels, pDecoder->internalChannelMap);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
extras/miniaudio_vorbis.h:172:73: error: ‘ma_decoder’ has no member named ‘internalChannels’
  172 |     ma_get_standard_channel_map(ma_standard_channel_map_vorbis, pDecoder->internalChannels, pDecoder->internalChannelMap);
      |                                                                         ^~
extras/miniaudio_vorbis.h:172:101: error: ‘ma_decoder’ has no member named ‘internalChannelMap’
  172 |     ma_get_standard_channel_map(ma_standard_channel_map_vorbis, pDecoder->internalChannels, pDecoder->internalChannelMap);
      |                                                                                                     ^~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions