iOS Question #solved# iMedia v1.20 - Audio Recording

ilan

Expert
Licensed User
Longtime User
hi,

i am using the lib iMedia v1.20 to record audio
and everything works fine but i got 1 question
after i record i play the recorded file and i hear the sound only from the ear speaker and not from the phone speaker after closing the app and start again i hear it from the Speakers.

i think after intialize the audiorecorder its playing the sound from the earspeaker and by closing the app and open again (without intializing the audio recorder) i hear it from my speakers...

is there an option to de-intialize the audiorecorder? so i will hear the sound from the speakers...

thanx, ilan
 

ilan

Expert
Licensed User
Longtime User

didnot help me...

i have no problem that the sound goes down.
the problem is after i record and play the audio file i hear the sound not from the regular speaker of the phone i hear it from the EAR SPEAKER

so in the beginning i tought the sound did go down thats because the ear speaker put out the file and the the regualr speaker...
if i put the phone to my ear i hear very clear and after i close the app and enter it again and play the sound i hear it from the regular speaker... (i think intialize the audio recorder change the speakers so all sounds are playing from the ear speaker instead of the regular speakers)
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
ok small correction
it did helped me BUT i put it BEFORE i play the sound and not before i record the audio (It makes more sense)

B4X:
'play audio


        #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)

    If audiomp.IsInitialized Then        
        audiomp.Play
        reclbl.Text = "Playing..."
        reclbl.TintColor = Colors.Blue    
        rectimer.Enabled = True
    End If

thank you erel for your help :)
 
Upvote 0
Top