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

Error: Requires permission android.permission.RECORD_AUDIO #4

Open
unquote7083 opened this issue Jun 22, 2022 · 4 comments
Open

Error: Requires permission android.permission.RECORD_AUDIO #4

unquote7083 opened this issue Jun 22, 2022 · 4 comments

Comments

@unquote7083
Copy link

$ am startservice -a android.intent.action.TRANSCRIBE -d file:///storage/emulated/0/Music/test.wav --grant-read-uri-permission studio.hikari.spellbook/studio.hikari.spellbook.SpeechToTextCoordinator
Starting service: Intent { act=android.intent.action.TRANSCRIBE dat=file:///storage/emulated/0/Music/test.wav flg=0x1 cmp=studio.hikari.spellbook/.SpeechToTextCoordinator }

Error: Requires permission android.permission.RECORD_AUDIO

Android 11

@Tadashi-Hikari
Copy link
Owner

This might be a Termux-API required permission. I'll look in to it

@unquote7083
Copy link
Author

Ah thanks for the pointer.

I didn't have Termux-API installed so I did that now (https://f-droid.org/en/packages/com.termux.api/)

Then I granted Termux-API microphone permission in the android settings.

I also installed termux-api package with pkg install termux-api although I don't know if that was necessary.

Now the permission error is gone.

Then I got an error

RunCommandService requires `allow-external-apps` property to be set to `true` in `~/.termux/termux.properties` file

So I fixed that.

@unquote7083
Copy link
Author

What type of audio files are supported? I tried recording one with termux-microphone-record but the the transcript file is empty leading me to believe it didn't process correctly.

Also where does sapphire-core.py come from? Where is the source code?

@Tadashi-Hikari
Copy link
Owner

Tadashi-Hikari commented Jun 28, 2022

it's` designed to work on .wav files, you can check the encoding using ffmpeg from within termux. This should also be the default microphone recording format if you use termux-microphone-record.

A note on that, when stopping termux-microphone-record, you need to give the system a second (I use a 200 ms wait) to finalize the file before you do anything with the data.

sapphire-core.py doesn't come from anywhere. I have a personal script I was using for it that ties into the Sapphire assistant/Sapphire Framework prototype I've been working on in Python. You can make a file called sapphire-core.py and put ANY python into it, and it'll executre.

Personally, I was using it to take the transcription file and use it to interpret the command of the user. A form of running an assistant with 'less than real time' command recognition

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

2 participants