iOS Question Record TTS output to file

Discussion in 'iOS Questions' started by hanyelmehy, Apr 7, 2015.

Similar threads

Bug? TTS error in Debug
Bug? TTS won't speech
B4i Question TTS isSpeaking ?
B4i Question Donald Duck effect
B4i Question Wait for TTS to finish.
  1. hanyelmehy

    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)
    Code:
    Sub BT1_Click
       Rec1.Initialize(
    File.DirDocuments, "rec1.dat",22050False,1False)
        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
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Not sure that there is a solution for this. However why do you need to save it for? You can always play the text again with TTS.
     
  3. hanyelmehy

    hanyelmehy Active Member Licensed User

    i need to save it ,to share it to others as attached file
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Call this code after you initialize the recorder and before you call record:
    Code:
    #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
     
  5. Rick Harris

    Rick Harris Well-Known Member Licensed User

  6. moster67

    moster67 Expert Licensed User

  7. Rick Harris

    Rick Harris Well-Known Member Licensed User

    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: Oct 5, 2015
  8. moster67

    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 likes this.
  9. Rick Harris

    Rick Harris Well-Known Member Licensed User

    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: Oct 5, 2015
  10. Erel

    Erel Administrator Staff 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.
     
  11. Rick Harris

    Rick Harris Well-Known Member Licensed User

    No I have now really finished moaning.... :) Apparently I am in the minority.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice