Hi, I am trying to read an audio from src/androidMain/res then make transcription. Here is my code:
suspend fun func() {
val myAudioPath = "test_audio.mp3".toPath()
val audioSource = FileSource(path = myAudioPath, fileSystem = FileSystem.RESOURCES)
val request = TranscriptionRequest(
audio = audioSource,
model = ModelId("whisper-1"),
)
val transcription = openAI.transcription(request)
println(transcription.text)
}
However, I was warned "Unresolved reference: RESOURCES" while I could build the program normally. When I began running the program, I received an error: "file not found: test_audio.mp3". Is there any wrong with my code ? How can I fix it?
Furthermore, when I call FileSource(name, source), I found out that ByteArray do not have a member function named asSource(), however, such function appeared here. Could you please tell me how can I use it?
Hi, I am trying to read an audio from src/androidMain/res then make transcription. Here is my code:
However, I was warned "Unresolved reference: RESOURCES" while I could build the program normally. When I began running the program, I received an error: "file not found: test_audio.mp3". Is there any wrong with my code ? How can I fix it?
Furthermore, when I call FileSource(name, source), I found out that ByteArray do not have a member function named asSource(), however, such function appeared here. Could you please tell me how can I use it?