Version

menu_open

ak.wwise.core.audioSourcePeaks.getMinMaxPeaksInRegion


Get the min/max peak pairs, in a given region of an audio source, as a collection of binary strings (one per channel). If getCrossChannelPeaks is true, there will be only one binary string representing peaks across all channels globally.

Supported by

Graphical User Interface, Command-Line Interface.

Arguments

Name Type Description
object   The ID (GUID) or path of the object.
timeFrom number The start time, in seconds, of the section of the audio source for which peaks are required
timeTo number The end time, in seconds, of the section of the audio source for which peaks are required
numPeaks number The number of peaks that are required
getCrossChannelPeaks boolean When true, peaks will be calculated globally across channels, instead of per channel.

Arguments Details


object

description : The ID (GUID) or path of the object.
Possibilities, one of the following :

1) type : string
pattern : ^\{[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\}$

2) type : string
pattern : ^\

timeFrom

type : number
description : The start time, in seconds, of the section of the audio source for which peaks are required

timeTo

type : number
description : The end time, in seconds, of the section of the audio source for which peaks are required

numPeaks

type : number
description : The number of peaks that are required

getCrossChannelPeaks

type : boolean
description : When true, peaks will be calculated globally across channels, instead of per channel.


Result

Name Type Description
peaksBinaryStrings array An array of binary strings. Each binary string represents one channel of min max peaks data. When getCrossChannelPeaks is true there will only be one binary string in this array, representing the min max peaks across all channels.
numChannels number The number of channels of peak data (i.e. the number of strings in peaksBinaryStrings). This will be 1 if getCrossChannelPeaks is true.
maxAbsValue number The maximum value that a peak can take. This can be used to normalize the peaks in the array (between -1, 1), by dividing each by this number.
peaksArrayLength number The number of peaks in the returned min max channel arrays. If peaksArrayLength is less than the numPeaks input argument, this indicates fewer samples were available than numPeaks requested. In this case, the arrays contain all of the sample values within the requested time window.
peaksDataSize number The size of the data in the peaks min max arrays. This can be used (in conjuction with peaksArrayLength) to decode the peaksBinaryStrings to 16 bit integer arrays

Result Details


peaksBinaryStrings

type : array

resultSchema / peaksBinaryStrings / ...

items

type : string
description : An array of binary strings. Each binary string represents one channel of min max peaks data. When getCrossChannelPeaks is true there will only be one binary string in this array, representing the min max peaks across all channels.

numChannels

type : number
description : The number of channels of peak data (i.e. the number of strings in peaksBinaryStrings). This will be 1 if getCrossChannelPeaks is true.

maxAbsValue

type : number
description : The maximum value that a peak can take. This can be used to normalize the peaks in the array (between -1, 1), by dividing each by this number.

peaksArrayLength

type : number
description : The number of peaks in the returned min max channel arrays. If peaksArrayLength is less than the numPeaks input argument, this indicates fewer samples were available than numPeaks requested. In this case, the arrays contain all of the sample values within the requested time window.

peaksDataSize

type : number
description : The size of the data in the peaks min max arrays. This can be used (in conjuction with peaksArrayLength) to decode the peaksBinaryStrings to 16 bit integer arrays


Examples :

Get peaks per channel

Get peaks for an audio source object.

Arguments:

{
    "object": "{AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE}", 
    "timeFrom": 0.0, 
    "timeTo": 2.0, 
    "numPeaks": 750, 
    "getCrossChannelPeaks": false
}

Result:

{
    "peaksBinaryStrings": [
        "longbase64string", 
        "longbase64string"
    ], 
    "numChannels": 2, 
    "maxAbsValue": 32767, 
    "peaksArrayLength": 750, 
    "peaksDataSize": 1000
}

Get peaks across channels

Get peaks for an audio source object.

Arguments:

{
    "object": "{AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE}", 
    "timeFrom": 0.0, 
    "timeTo": 2.0, 
    "numPeaks": 750, 
    "getCrossChannelPeaks": true
}

Result:

{
    "peaksBinaryStrings": [
        "longbase64string"
    ], 
    "numChannels": 2, 
    "maxAbsValue": 32767, 
    "peaksArrayLength": 750, 
    "peaksDataSize": 1000
}


Detailed JSON Schema


Arguments :

{
    "type": "object", 
    "properties": {
        "object": {
            "description": "The ID (GUID) or path of the object.", 
            "anyOf": [
                {
                    "type": "string", 
                    "pattern": *Must be a valid GUID*
                }, 
                {
                    "type": "string", 
                    "pattern": "^\\\\"
                }
            ]
        }, 
        "timeFrom": {
            "type": "number", 
            "description": "The start time, in seconds, of the section of the audio source for which peaks are required"
        }, 
        "timeTo": {
            "type": "number", 
            "description": "The end time, in seconds, of the section of the audio source for which peaks are required"
        }, 
        "numPeaks": {
            "type": "number", 
            "description": "The number of peaks that are required"
        }, 
        "getCrossChannelPeaks": {
            "type": "boolean", 
            "description": "When true, peaks will be calculated globally across channels, instead of per channel."
        }
    }, 
    "additionalProperties": false
}


Options :

{
    "type": "object", 
    "required": [], 
    "properties": {}, 
    "additionalProperties": false
}


Response :

{
    "type": "object", 
    "properties": {
        "peaksBinaryStrings": {
            "type": "array", 
            "items": {
                "type": "string"
            }, 
            "description": "An array of binary strings. Each binary string represents one channel of min max peaks data. When getCrossChannelPeaks is true there will only be one binary string in this array, representing the min max peaks across all channels."
        }, 
        "numChannels": {
            "type": "number", 
            "description": "The number of channels of peak data (i.e. the number of strings in peaksBinaryStrings). This will be 1 if getCrossChannelPeaks is true."
        }, 
        "maxAbsValue": {
            "type": "number", 
            "description": "The maximum value that a peak can take. This can be used to normalize the peaks in the array (between -1, 1), by dividing each by this number."
        }, 
        "peaksArrayLength": {
            "type": "number", 
            "description": "The number of peaks in the returned min max channel arrays. If peaksArrayLength is less than the numPeaks input argument, this indicates fewer samples were available than numPeaks requested. In this case, the arrays contain all of the sample values within the requested time window."
        }, 
        "peaksDataSize": {
            "type": "number", 
            "description": "The size of the data in the peaks min max arrays. This can be used (in conjuction with peaksArrayLength) to decode the peaksBinaryStrings to 16 bit integer arrays"
        }
    }, 
    "additionalProperties": false
}

Document version : 1


Was this page helpful?

Need Support?

Questions? Problems? Need more info? Contact us, and we can help!

Visit our Support page

Tell us about your project. We're here to help.

Register your project and we'll help you get started with no strings attached!

Get started with Wwise