iOS Question Record TTS output to file

Similar threads

B4i Question TTS Problem
Bug? TTS error in Debug
Bug? TTS won't speech
B4i Question Donald Duck effect
B4i Question TTS isSpeaking ?

hanyelmehy

Active Member
Licensed User
i try to record TTS Speaking to a file
when not using record method ,TTS Volume is high
when Add Record method Volume go too low (in both cases when tts play and when recorded file play)
B4X:
Sub BT1_Click
   Rec1.Initialize(File.DirDocuments, "rec1.dat",22050, False,1, False)
    Rec1.Record
   
   
    TTS1.SetLanguage("en-US")
    TTS1.SpeechRate=StateManager.GetSetting2("TTSRate",TTS1.SpeechRate)
    TTS1.Pitch=StateManager.GetSetting2("TTSPitch",TTS1.Pitch)
    TTS1.Speak(MyText,True)

End Sub
rivate Sub TTS1_Complete(Text As String)
 
  Rec1.Stop
  Log("play")
  Mp1.Initialize(File.DirDocuments,"rec1.dat","Mp1")
  Mp1.Volume=10
  Mp1.Play
 
 
End Sub
 

Erel

Administrator
Staff member
Licensed User
Call this code after you initialize the recorder and before you call record:
B4X:
#If OBJC
#import <AVFoundation/AVFoundation.h>
#import <AudioToolbox/AudioToolbox.h>
- (void)setAudioSession {
 [[AVAudioSession sharedInstance]
   setCategory:AVAudioSessionCategoryPlayAndRecord
   withOptions:AVAudioSessionCategoryOptionDefaultToSpeaker error:nil];
}
#end if

Dim no As NativeObject = Me
no.RunMethod("setAudioSession", Null)
This is based on this answer: http://stackoverflow.com/questions/...e-recording-sound-with-avaudiorecorder-in-ios
 

Rick Harris

Well-Known Member
Licensed User
I think that is a B4a-library - the question was about iOS...o_O
OK, thank you for telling me. I overlooked this. This is what happens as a result of the mess in the Forum now in which B4A, B4j and B4i have been totally mixed up together. I really hate it and truly wish that the Forum would be as it was two years ago. My recommendation is still to split the Forum into separate B4a, B4j, B4i, Java and General sections, or at least that proper filters are added. Unfortunately, Erel and others see this differently. See:
http://www.b4x.com/android/forum/th...-mess-with-this-mix-of-b4a-b4j-and-b4i.57796/

Even if I start to type "B4a" in the Forum search field (without anything else) a number of B4j and B4i suggested topics pop up. So I can't even use this trick as a filter. Really horrible!
 
Last edited:

moster67

Expert
Licensed User
While I can appreciate your concern, personally I don't have any problems and I prefer things as they currently stand. Maybe that is because I am using all B4x products and often code-samples are interchangeable so many queries/questions relate and I am keen on reading them all. Nonetheless I can understand and respect your point of view....
 

Rick Harris

Well-Known Member
Licensed User
While I can appreciate your concern, personally I don't have any problems and I prefer things as they currently stand. Maybe that is because I am using all B4x products and often code-samples are interchangeable so many queries/questions relate and I am keen on reading them all. Nonetheless I can understand and respect your point of view....
Thank you for your understanding. I only program in B4A and am not at all interested in iOS. I am surprised that not more people have shared by frustration about the confusing forum and non-existent filtering. If only I could somehow discard (hide) all the non B4A stuff, including B4J, B4I, JAVA, General etc. I don't want to know about JAVA. The whole idea of B4A is to program in Visual-Basic alike code, I thought...! Someone who programs in C++ does not want to read about Pascal, Delphi or other languages. A similar argument applies to B4A. I hardly use the Forum anymore and am really hating it more and more every day. So much "clutter"! All these other language contributions in Spanish, Italian, German a.o. create even more "mess". In addition there are many "Wish" forum entries. Often it is unclear which of the B4x parts they involve, unless you open them.
The dates for each forum entry are also confusing. There are entries from 2011 that are shown above those from 2015 (probably because the date is shown when the topic was first created and not the date of the last contribution in that thread).

I am not an unexperienced programmer. Take a look at my ARTI app which has nearly 3000 functions (for blind users): https://play.google.com/store/apps/details?id=arti1.dsh

Sorry, I have had a bad day and need something to grumble about :)
 
Last edited:

Rick Harris

Well-Known Member
Licensed User
Maybe there is a reason for that ;)
If you want to further discuss the forum structure then start a new thread in the "Forum Discussion" sub-forum.
No I have now really finished moaning.... :) Apparently I am in the minority.
 
Top