Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AXVoiceOffsets offs;
- AXVoiceVeData vol = {
- .volume = 0x8000,
- };
- AXVoiceDeviceMixData drcmix = {
- .bus = {
- { .volume = 0x8000 }, //bus 0
- { .volume = 0x0000 }, //bus 1
- { .volume = 0x0000 }, //bus 2
- { .volume = 0x0000 }, //bus 3
- },
- };
- AXVoiceDeviceMixData tvmix = drcmix;
- if (!AXIsInit()) {
- /* Init the AX audio engine */
- AXInitParams initparams = {
- .renderer = AX_INIT_RENDERER_48KHZ,
- .pipeline = AX_INIT_PIPELINE_SINGLE,
- };
- AXInitWithParams(&initparams);
- }
- AXSetDRCVSMode(0);
- musicVoice = AXAcquireVoice(31, NULL, NULL);
- AXVoiceBegin(musicVoice);
- AXSetVoiceType(musicVoice, 0);
- AXSetVoiceVe(musicVoice, &vol);
- AXSetVoiceDeviceMix(musicVoice, AX_DEVICE_TYPE_DRC, 0, &drcmix);
- AXSetVoiceDeviceMix(musicVoice, AX_DEVICE_TYPE_TV, 0, &tvmix);
- AXSetVoiceSrcRatio(musicVoice, 44100.0f / (float)AXGetInputSamplesPerSec());
- AXSetVoiceSrcType(musicVoice, AX_VOICE_SRC_TYPE_LINEAR);
- AXVoiceEnd(musicVoice);
- AXVoiceBegin(musicVoice);
- offs.dataType = AX_VOICE_FORMAT_LPCM8;
- offs.endOffset = sizeof(Sound_raw) - 1;
- offs.loopingEnabled = AX_VOICE_LOOP_ENABLED;
- offs.loopOffset = 0;
- offs.currentOffset = 0;
- offs.data = &Sound_raw;
- AXSetVoiceOffsets(musicVoice, &offs);
- AXSetVoiceState(musicVoice, AX_VOICE_STATE_PLAYING);
- AXVoiceEnd(musicVoice);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement