我有以下代码来播放 mp3:
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 卡上的播放器发出声音?
谢谢你。