I was so happy that I managed to buy a new license to upgrade my app to 64 bit… until I tried to audio record with it.
I am using AVfoundationMBS and it was working great.
However… since upgrading the 64 bit, the recording stopped working. I can still manipulate audio files - i.e. slicing and playing and speed control…
But the recording is not working. Luckily I had a parallels with Mojave on it (I’m now in Catalina). The audio recording worked as good as it ever did.
64 bit - no luck.
Does anybody know about this? Any solutions?
Cheers,
Sean
[code]
dim f as FolderItem = SpecialFolder.SharedApplicationData.Child(“Guitar SightReader Toolbox”).child(“recording bin”).child(“transcribe”).Child( “temp.caf”)
dim recordSetting as new Dictionary
dim n as integer = OSTypeFromStringMBS(TranAVFoundation.kAudioFormatLinearPCM)
recordSetting.Value(AVFoundationMBS.AVFormatIDKey) = n
recordSetting.Value(AVFoundationMBS.AVSampleRateKey) = 44100.0
recordSetting.Value(AVFoundationMBS.AVNumberOfChannelsKey) = 2
recordSetting.Value(AVFoundationMBS.AVLinearPCMBitDepthKey) = 16
recordSetting.Value(AVFoundationMBS.AVLinearPCMIsBigEndianKey) = false
recordSetting.Value(AVFoundationMBS.AVLinearPCMIsFloatKey) = false
dim error as NSErrorMBS
recorder = new AVAudioRecorderMBS(f, nil, error)
if error<>Nil then
MsgBox error.LocalizedDescription
Return
end if
if recorder.record then
// ok
TranAVFoundation.CurrentFile = f
else
MsgBox “Failed to start recording.”
end if[/code]
I downloaded the latest ones… They don’t work either - it works in 32bit but not 64 bit. This is a real bummer as I spent a load of money to get the latest Xojo version because of Catalina and now I’m hamstrung because AVFoundationMBS doesn’t record in 64 bit
For macOS Catalina you need to do 3 things to make it work:
Ask the user for permission. With the MBS plugins you need to use requestAccessForMediaType. If you do not add this, no access is granted for your app.
Add the plist entry that Christian explained.
Codesign your app
I use Appwrapper for doing the second and third steps.
I know where the Plist is… inside the contents of the app…
I need to know what text I need to add… i.e.
so I added:
<key>NSCameraUsageDescription</key>
<string>Demo</string>
<key>NSMicrophoneUsageDescription</key>
<string>Demo</string>
to my Plist.info
Is there anything else I need to add?
What is the syntax for adding requestAccessForMediaType to my project and where does it go?
am I correct in assuming I have to pay Apple to have a code to code sign with? I have never dealt with this previously - 32 bit version works great as expected.
Man, you were really really really lucky. Again: do a goggle on “codesign on macos”. You need to buy a certificate. Then you need to imagine you have to do your taxes crossed with having a root canal. If everything works then it’s okay. If you get an error then everything falls apart because the errors are really terrible. See recent posts from Greg Grzech (spelling?).
You can let AppWrapper do everything. My app is too complicated for AppWrapper so I do the codesign myself and let AppWrapper do the notarization part. There are some examples around how to do both.
Thanks for your comments Beatrix - what I’m really looking for is a way to record audio. port audio examples also dont work. Christian - do you think you could cobble up a small app that records audio in 64bit and plays it back? That would be magic!
Did you read the thread thoroughly?
All info how to record audio and/or video is here.
The key is you now have to add code that asks the customer to grand permission to use micro/camera.
It does require some extra work to implement it correctly.
There are several MBS examples showing how to do this.
First of all - Once you’ve built your app, right click on it to open the package contents. Then open contents.
Edit the file info.plist with text edit.
For this to work, you need something between the . I have put the name of my app. If you don’t put anything between these two, it will not ask to access your microphone or any other audio source (I am usually using my scarlet audio to record from as I play rock guitar and I like a clearer signal than the microphone).
Thanks to Christian Schmitz and monkeybread for the fix. Everything audio recording now works perfectly on my built 64-bit app!
That’s because I don’t know how to do that - it works just great like I’m doing it now (although I had to build it every time I was testing my audio export feature).