Closed rhysmorgan134 closed 8 months ago
@rhysmorgan134 what if instead a new command we do something like:
if (audio.data) { const { decodeType, data } = audio const format = decodeTypeMap[decodeType] const player = getAudioPlayer(format) player.feed(data) } else if (audio.volumeDuration) { const { decodeType, volume, } = audio const format = decodeTypeMap[decodeType] const player = getAudioPlayer(format) player.volume(volume, volumeDuration) } else if (audio.command) {
The volume messages were being ignore as they were coming with no command type and there was no default case in the switch statement. I''m proposing to create our own command type where when the extra bytes are 4 it attaches the command type of
AudioVolumeAdjust
, useCarplayAudio then adjusts the volume using the new functionality it pcm-ringbuf-playerhttps://github.com/gozmanyoni/pcm-ringbuf-player/pull/5