Android Question WAV file to text

Brian Dean

Well-Known Member
Licensed User
Longtime User
Yes it is, if you want the text to be the file content in hexadecimal notation, for instance. But I don't think that is what you are looking for.
 
Upvote 0

peggjones

Active Member
Licensed User
Longtime User
The file object in my version of B4A does not have a readbytes method. Is this because the version I have is out of date? I have version 8.00
 
Upvote 0

npsonic

Active Member
Licensed User
The file object in my version of B4A does not have a readbytes method. Is this because the version I have is out of date? I have version 8.00
Use this
B4X:
Sub ReadBytes (Dir As String, Filename As String) As Byte()
    Dim input As InputStream = File.OpenInput(Dir,Filename)
    Dim b(input.BytesAvailable) As Byte
    input.ReadBytes(b,0,b.Length)
    input.Close
    Return b
End Sub
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
u will really convert a wave file to string? why?
u will save it into a sqllite db?
 
Upvote 0

peggjones

Active Member
Licensed User
Longtime User
Thanks for that but what I actually want it to do is to return as text the contents of the wav file.
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
removed because misunderstood
 
Last edited:
Upvote 0

udg

Expert
Licensed User
Longtime User
As I understand it, the OP would like to "transcribe" the content of the WAV file to plain text, i.e. from a recorded vocal message to its corresponding text, then save the text in a DB.
Maybe an online service offered by some big data company? I didn't search for it...it's coffee time!
 
Upvote 0

peggjones

Active Member
Licensed User
Longtime User
What I am trying to achieve is to record people speaking in different languages and convert the recorded files to text for analysis of the structure of the different languages. Sounds a bit odd I know but it is for a linguistics project.
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
ahh, do you still need the wave file then or u just need the text?

for voice to text i used this
B4X:
Sub ButtonNoteVoice_Click

    Dim Voice1 As MyVoice
    Voice1.Initialize

    Wait For (Voice1.RecognizeVoice) Complete (Result As String)
    EditTextNote.Text= Result
    
End Sub

Class MyVoice
B4X:
Sub Class_Globals
    Private Voice1 As VoiceRecognition 'Phone library
End Sub

'Initialisiert das Objekt. Falls nötig kannst du Parameter zu dieser Methode hinzufügen.
Public Sub Initialize
    Voice1.Initialize("Voice1")
    Voice1.Language="de"
End Sub

public Sub RecognizeVoice As ResumableSub
    Voice1.Listen
    Wait For Voice1_Result (Success As Boolean, Texts As List)
    If Success And Texts.Size > 0 Then       
        Return "" & Texts.Get(0)
    End If
    Return ""
End Sub
 
Upvote 0

MarkusR

Well-Known Member
Licensed User
Longtime User
ok, see above, maybe u can use it.
its without wave file.
i think without knowing the people spoken languages it will not work.
i guess you will try to create a phonetic language text from the recorded sound.
https://en.wikipedia.org/wiki/Phonetic_transcription
 
Last edited:
Upvote 0

udg

Expert
Licensed User
Longtime User
Last edited:
Upvote 0

peggjones

Active Member
Licensed User
Longtime User
You understand it perfectly, thanks for taking an interest. I'm surprised it's so difficult. I thought it would be dead straightforward, after all it is easy to record speech to a sound file.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…