en
en

Docs

 

Gaudio MusicOne SDK QuickStart Guide


The following explanations will help guide you to efficiently integrate Gaudio’s Music One SDK into your App

  • Product Overview
  • API Structure
  • Integration Guide

Product Overview

Gaudio’s MusicOne* SDK is a software that functions inside a media player. Most media players use a sequential pipeline where a media’s Demuxing, Decoding, Rendering process operates. In this pipeline, MusicOne SDK is between Decoding and Rendering. MusicOne SDK has great compatibility that operates in multiple different players. It further guarantees operation on a variety of platforms.

*MusicOne SDK is a suite of Gaudio technologies (products) includes any one or more of followings:

  • Loudness Normalization for music streaming
  • Smart EQ + G’Master
  • ELEQ
  • Spatial Upmix

Supported Format

Category Scope of format
Channels Mono, Stereo, 5.1ch (Loudness function only)
SamplingRate 44.1k, 48k, (Resampler function support)
Samples Per Block 512(default)
BitDepth short(16), float(32)

System features

Category Content
Supporting OS Android, iOS, MacOS, Win32, WinRT, Linux
Buffer Latency Max approximately 12.7 msec
Library Size not more than 700kb
Power consumption < 3.5% on ARM Cortex-A35 / Less than 1mA on Samsung Galaxy S7

Android

Category Recommended Spec
Recommanded device Higher version than Samsung Galaxy note 5
SDK Version Higher version than SDK Version 26

iOS

Category Recommended Spec
Recommanded OS Higher version than iOS 10.3.3
Toolchain version Higher version than XCODE 8.3

API Structure

The API of Gaudio’s MuiscOne SDK is followed “C”style in favor for being compatible in different languages. Regarding the nature of “C” language, an API is provided: the API create/removes the “Instance”, which retains the context(continuous buffer handling, state management, ect.) that must be maintained in each unit of media playback. Each API are designed to receive and input the context’s “Instance”. (*Contexts usually each receive different content of contexts if two music files are played continuously. However, depending on how you manage your “Instances”, you can “Cleanup” the “Instance” that was used in previous playbacks and reuse it. *)

The API is configured for the following purposes:

  • Create and remove instances
  • Context Cleanup
  • Context Setup and Update
  • Rendering
  • Internal buffer flush

(1) Create and remove instances

int music_one_create(gaudio_instance_t** ppInst);
int music_one_destroy(gaudio_instance_t** ppInst);

Return Type Description
G_SUCCESS Successful API call
G_NULL_EXCEPTION Invalid ppInst

(2) Context Cleanup

int music_one_reset(gaudio_instance_t* pInst);

Create to the initial state of “Instance”. (After API call “Instance” can be reused.)

Return Type Description
G_SUCCESS Successful API call
G_NULL_EXCEPTION Invalid ppInst

(3) Context Setup

typedef struct config {
unsigned int numInputChannels;
unsigned int sampleRate;
unsigned int samplesPerBlock;
unsigned int format;
unsigned char isResampler;
} config_t;
int music_one_setup(gaudio_instance_t* pInst,
const config_t* config,
const params_t* params);

Return Type Description
G_SUCCESS Successful API call
G_NULL_EXCEPTION Invalid ppInst
G_NOT_SUPPORT_CHANNELS Number of channels not supported
G_NOT_SUPPORT_SAMPLERATE Unsupported SamplingRate
G_NOT_SUPPORT_SAMPLES_PER_BLOCK Unsupported Samples Block size

(4) Change processing options during playback

int music_one_update(gaudio_instance_t* pInst,
const params_t* params);

Return Type Description
G_SUCCESS Successful API call
G_NULL_EXCEPTION Invalid ppInst
G_NOT_INITIALIZED Requires Context Setup call

(5) Processing

int music_one_process(gaudio_instance_t* pInst,
const void* in,
void* out,
unsigned int inSamples,
unsigned int* outSamples,
unsigned int format);

Return Type Description
G_SUCCESS Successful API call
G_NULL_EXCEPTION Invalid ppInst
G_NOT_INITIALIZED Requires Context Setup call
G_NOT_SUPPORT_SAMPLES_PER_BLOCK Unsupported Sample size.

(6) Internal Buffer Flush

Continuous data flow is lost when performing Trick functions such as Pause, Seek, SetPosition, etc. In such situation, flush the buffer while maintaining the status variables value.

int music_one_flush(gaudio_instance_t* pInst);

Return Type Description
G_SUCCESS Successful API call
G_NULL_EXCEPTION Invalid ppInst
G_NOT_INITIALIZED Requires Content initialization

Integration Guide

Android (Exoplayer)

MusicOne SDK is provided as a library in .aar format in order to be easily used in Android App development environments. This guide explains how to integrate MusicOne SDK into Android’s ExoPlayer-based App.
(for further specific information, refer to android_exoplayer_example)

STEP 1: Utilize GaudioAudioProcessor.java

GaudioAudioProcessor.java included is a Class inherited from the AudioProcessor in the Exoplayer.
This class uses the MusicOne Class included in the SDK library(.arr). Therefore, if you integrate GuadioAudioProcessor.jave into your App, a separate code does not require for SDK use.

STEP 2: Register GaudioAudioProcessor into ExoPlayer

Register GaudioAudioProcessor as you create ExoPlayer as shown below.
(for further specific information, refer to android_exoplayer_example’s PlayActivity.java)

...
private GaudioAudioProcessor mGaudioAudioProcessor;
...
mGaudioAudioProcessor = ExoPlayerFactory.newSimpleInstance(
new ProcessorFactory(this, mGaudioAudioProcessor),
trackSelector
);

STEP 3: Import Library when Build.

Android Library is available in .aar format. Add it to your APP build.gradle as shown below.

implementation project(‘:gaudioaudioprocessor’)
artifacts.add(default, file(‘../../lib/Android/aar/GaudioMusicOne-release.aar’))

iOS (AVPlayer)

The following explanation describes how to integrate MusicOne SDK into an AVPlayer-based app in IOS.
AVPlayer provides MTAudioPRocessingTap for post-audio processing.
Here’s how to integrate the MusicOne SDK (based on MT AudioProcessing Tap) into your app.
(for further specific information, refer to android_exoplayer_example)*

STEP 1: Register MTAudioProcessingTap at AVPlayer

Register a callback function which allows AVPlayer’s post-processing through MTAudioProcessingTapCreate()

MTAudioProcessingTapCallbacks callbacks;
MTAudioProcessingTapCreate(kCFAllocatorDefault,
&callbacks,
kMTAudioProcessingTapCreationFlag_PreEffects,
&audioProcessingTapRef_
);
AVMutableAudioMix *audioMix = [AVMutableAudioMix audioMix];
audioMix.inputParameters = @[inputParams];
playerItem.audioMix = audioMix;

STEP 2: Use MusicOne SDK from processing callback function

void process(MTAudioProcessingTapRef tap, CMItemCount numberFrames,
MTAudioProcessingTapFlags flags, AudioBufferList *bufferListInOut,
CMItemCount *numberFramesOut, MTAudioProcessingTapFlags *flagsOut)
{
...
music_one_process(instance_, sInputBuffer, sOutputBuffer, inSamples, (unsigned int*)outSamples, kFormatS16leI);
...
}


Privacy Settings
We use cookies to enhance your experience while using our website. If you are using our Services via a browser you can restrict, block or remove cookies through your web browser settings. We also use content and scripts from third parties that may use tracking technologies. You can selectively provide your consent below to allow such third party embeds. For complete information about the cookies we use, data we collect and how we process them, please check our Privacy Policy
Youtube
Consent to display content from Youtube
Vimeo
Consent to display content from Vimeo
Google Maps
Consent to display content from Google
Spotify
Consent to display content from Spotify
Sound Cloud
Consent to display content from Sound