libsdl-org / SDL_mixer

An audio mixer that supports various file formats for Simple Directmedia Layer.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

retrieve the level (peak amplitude)

thrive4 opened this issue · comments

Maybe there is an alternative trick with the sdl_mixer
that I am overlooking, if not, could it be worthwhile
implementing something similar to BASS_ChannelGetLevel?

https://www.un4seen.com/doc/#bass/BASS_ChannelGetLevel.html
'Retrieves the level (peak amplitude) of a sample, stream,
MOD music, or recording channel'

for clarity:
'This function measures the level of the channel's sample data
not its level in the final output mix, so the channel's volume
([BASS_ATTRIB_VOL](https://www.un4seen.com/doc/bass
/BASS_ATTRIB_VOL.html) attribute) and panning ([BASS_ATTRIB_PAN]
does not affect it'

Note un4seen bass has a quite sophisticated variant:
https://www.un4seen.com/doc/#bass/BASS_ChannelGetLevelEx.html