Advertisement
atm959

Bleh

Apr 11th, 2019
347
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.41 KB | None | 0 0
  1. AXVoiceOffsets offs;
  2.    AXVoiceVeData vol = {
  3.       .volume = 0x8000,
  4.    };
  5.    AXVoiceDeviceMixData drcmix = {
  6.       .bus = {
  7.          { .volume = 0x8000 }, //bus 0
  8.          { .volume = 0x0000 }, //bus 1
  9.          { .volume = 0x0000 }, //bus 2
  10.          { .volume = 0x0000 }, //bus 3
  11.       },
  12.    };
  13.    AXVoiceDeviceMixData tvmix = drcmix;
  14.    if (!AXIsInit()) {
  15.    /*  Init the AX audio engine */
  16.       AXInitParams initparams = {
  17.          .renderer = AX_INIT_RENDERER_48KHZ,
  18.          .pipeline = AX_INIT_PIPELINE_SINGLE,
  19.       };
  20.       AXInitWithParams(&initparams);
  21.    }
  22.    AXSetDRCVSMode(0);
  23.    musicVoice = AXAcquireVoice(31, NULL, NULL);
  24.    AXVoiceBegin(musicVoice);
  25.    AXSetVoiceType(musicVoice, 0);
  26.    AXSetVoiceVe(musicVoice, &vol);
  27.    AXSetVoiceDeviceMix(musicVoice, AX_DEVICE_TYPE_DRC, 0, &drcmix);
  28.    AXSetVoiceDeviceMix(musicVoice, AX_DEVICE_TYPE_TV, 0, &tvmix);
  29.    AXSetVoiceSrcRatio(musicVoice, 44100.0f / (float)AXGetInputSamplesPerSec());
  30.    AXSetVoiceSrcType(musicVoice, AX_VOICE_SRC_TYPE_LINEAR);
  31.    AXVoiceEnd(musicVoice);
  32.    AXVoiceBegin(musicVoice);
  33.    offs.dataType = AX_VOICE_FORMAT_LPCM8;
  34.    offs.endOffset = sizeof(Sound_raw) - 1;
  35.    offs.loopingEnabled = AX_VOICE_LOOP_ENABLED;
  36.    offs.loopOffset = 0;
  37.    offs.currentOffset = 0;
  38.    offs.data = &Sound_raw;
  39.    AXSetVoiceOffsets(musicVoice, &offs);
  40.    AXSetVoiceState(musicVoice, AX_VOICE_STATE_PLAYING);
  41.    AXVoiceEnd(musicVoice);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement