feat: audio resources
This commit is contained in:
@@ -30,15 +30,13 @@ extern "C" {
|
||||
JNIEXPORT jlong JNICALL
|
||||
Java_at_lockstep_pb_PlaybackEngine_native_1createEngine(
|
||||
JNIEnv *env,
|
||||
jclass /*unused*/) {
|
||||
/*
|
||||
jclass /*unused*/, jstring filesDir) {
|
||||
const char* filesDirTemp = env->GetStringUTFChars(filesDir, NULL);
|
||||
std::string filesDirString(filesDirTemp);
|
||||
env->ReleaseStringUTFChars(filesDir, filesDirTemp);
|
||||
*/
|
||||
|
||||
// We use std::nothrow so `new` returns a nullptr if the engine creation fails
|
||||
auto *engine = new(std::nothrow) PlaybackEngine();
|
||||
auto *engine = new(std::nothrow) PlaybackEngine(filesDirString);
|
||||
return reinterpret_cast<jlong>(engine);
|
||||
}
|
||||
|
||||
@@ -51,4 +49,13 @@ jlong engineHandle) {
|
||||
delete reinterpret_cast<PlaybackEngine *>(engineHandle);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_at_lockstep_pb_PlaybackEngine_native_1setDefaultStreamValues(JNIEnv *env,
|
||||
jclass type,
|
||||
jint sampleRate,
|
||||
jint framesPerBurst) {
|
||||
oboe::DefaultStreamValues::SampleRate = (int32_t) sampleRate;
|
||||
oboe::DefaultStreamValues::FramesPerBurst = (int32_t) framesPerBurst;
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
|
||||
Reference in New Issue
Block a user