0
我有以下代碼播放MP3:強制USB音頻輸出
audioPlayer = new SuperpoweredAdvancedAudioPlayer(&audioPlayer, playerEventCallbackA, samplerate, 0);
audioPlayer->open(path, 0, fileLength);
audioSystem = new SuperpoweredAndroidAudioIO(samplerate, buffersize, false, true, audioProcessing, this, -1, SL_ANDROID_STREAM_MEDIA, 0);
……………
bool silence = !audioPlayer->process(stereoBuffer, false, numberOfSamples);
if (!silence) {
// The stereoBuffer is ready now, let’s put the finished audio into the requested buffers.
SuperpoweredFloatToShortInt(stereoBuffer, output, numberOfSamples);
}
和我有下面的代碼連接到USB卡:
int r = SuperpoweredUSBSystem::onConnect(deviceID, fd, (unsigned char *) rd, env->GetArrayLength(rawDescriptor));
if (r & 1) {
SuperpoweredUSBAudio::easyIO(deviceID, 44100, 16, 0, 256, SuperpoweredUSBLatency_Low, this, audioProcessing);
}
請幫我知道 - 如何在USB卡上播放聲音?
謝謝。