Community Q&A

Welcome to Audiokinetic’s community-driven Q&A forum. This is the place where Wwise and Strata users help each other out. For direct help from our team, please use the Support Tickets page. To report a bug, use the Bug Report option in the Audiokinetic Launcher. (Note that Bug Reports submitted to the Q&A forum will be rejected. Using our dedicated Bug Report system ensures your report is seen by the right people and has the best chance of being fixed.)

To get the best answers quickly, follow these tips when posting a question:

  • Be Specific: What are you trying to achieve, or what specific issue are you running into?
  • Include Key Details: Include details like your Wwise and game engine versions, operating system, etc.
  • Explain What You've Tried: Let others know what troubleshooting steps you've already taken.
  • Focus on the Facts: Describe the technical facts of your issue. Focusing on the problem helps others find a solution quickly.

+1 vote

Hello all.

I'm trying to understand the kind of data that can be passed into a audio buffer channel.

According to https://www.audiokinetic.com/library/2015.1_5418/?source=SDK&id=soundengine__plugins.html#fx_audiobuffer_struct

    Audio buffers’ channels are not interleaved, and all samples are normalized 32-bit floating point in the (-1.f,1.f) range running at a 48 kHz sampling rate.

So, as an example, is it possible to simply read a RAW file, Mono track, 48 kHz, little endian 32 bit float data straight from disk and feed into into a channel, like so ? 

// Note: length of file and eventual starvation is not my concern for the moment.

AKRESULT CAkFXSrcRawFile::Init(    
    AK::IAkPluginMemAlloc *            /*in_pAllocator*/,     /// Memory allocator interface.
    AK::IAkSourcePluginContext *in_pSourceFXContext,/// Sound engine plug-in execution context.
    AK::IAkPluginParam *in_pParams,            /// Associated effect parameters node.
    AkAudioFormat &    io_rFormat            /// Output audio format.
)
{
    io_rFormat.SetAll(48000, AK_SPEAKER_SETUP_MONO, 32, 1, AK_FLOAT, AK_NONINTERLEAVED);

        m_pFile = fopen("mysound.raw", "rb")
}

    void CAkFXSrcRawFile::Execute(AkAudioBuffer* io_pBufferOut)
    {
     if (io_pBufferOut->NumChannels())
    {
        AkSampleType* ch0Buffer = io_pBufferOut->GetChannel(0);

        io_pBufferOut->uValidFrames = fread(ch0Buffer, sizeof(AkSampleType), io_pBufferOut->MaxFrames(), m_pFile);
    
        if (!feof(m_pFile) && io_pBufferOut->uValidFrames > 0)
        {
            io_pBufferOut->eState = AK_DataReady;
            return;
        }
    }
    
    io_pBufferOut->eState = AK_NoDataReady;
   }

 

 

in General Discussion by Marc S. (120 points)

Please sign-in or register to answer this question.

...