Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileSystem.RESOURCES unresolved #351

Open
NovemberJay opened this issue Jun 14, 2024 · 0 comments
Open

FileSystem.RESOURCES unresolved #351

NovemberJay opened this issue Jun 14, 2024 · 0 comments

Comments

@NovemberJay
Copy link

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?

@NovemberJay NovemberJay changed the title [Brief Issue Description] FileSystem.RESOURCES unresolved FileSystem.RESOURCES unresolved Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant