Recent

Author Topic: Recording Mic on MacOS Bass.dll  (Read 179 times)

axisdj

  • New Member
  • *
  • Posts: 37
Recording Mic on MacOS Bass.dll
« on: May 23, 2020, 04:44:06 pm »
Hello Group,

I need some guidance. I have my app working in Windows(i can select mic device and input (master) and record to file), but when I move to macOS my Bass_RecordGetInputName does not return any input names.

The mic shows connected in System Preferences / Sound / Input and shows level

For testing purposes I have tried:

Bass_RecordInit(-1) or (0) with success
Bass_RecordSetDevice(0) or (-1) with success
but
Bass_RecordSetinput filas with error code 20 no matter what I try, which makes sense because there are no input name found.

I am very new to MAC development, is there some kind of magic setting that may be blocking MIC permissions? Any guidance on this would be much appreciated.

I have posted this on the bass.dll forum as well, but hoping for some insight on the MACos side here?

Thanks!

axisdj

  • New Member
  • *
  • Posts: 37
Re: Recording Mic on MacOS Bass.dll
« Reply #1 on: May 25, 2020, 07:26:35 pm »
Ok...

I got it working.

Please correct me if I am wrong but here is what I discovered.

On MACos the app needs to run in the app bundle. In the plist file of that bundle microphone access needs to be specified. then when the app runs a dialog will appear to allow mic access.

For testing I just placed my resource files and app bundle on desktop, need to figure out how to get resource folder path using code, so I can place all resources in proper place on MacOS.

Boy, is macOS annoyingly structured or what. (from pc guy of 20 years)

trev

  • Hero Member
  • *****
  • Posts: 668
  • Former Delphi 1-7 and 10.2 User
Re: Recording Mic on MacOS Bass.dll
« Reply #2 on: May 26, 2020, 03:01:46 am »
If by "app needs to run in the app bundle" you mean a bass.dylib dynamic library (cf dll in Windows), then the dynamic library file should be stored in the bundle's Frameworks directory. See the Wiki artcile on  [https://wiki.lazarus.freepascal.org/Application_Bundle]Application Bindles[/ur].

For testing I just placed my resource files and app bundle on desktop, need to figure out how to get resource folder path using code, so I can place all resources in proper place on MacOS.

See the Wiki article [https://wiki.lazarus.freepascal.org/Locating_the_macOS_application_resources_directory]Locating the macOS application resources directory]. However, if you mean locating your dylib in the the Frameworks directory, see the Wiki article on macOS Dynamic Libraries paying attention the the install_name_tool.

There's a lot of macOS-specific information to be found in the Wiki's Mac Portal.

Quote
Boy, is macOS annoyingly structured or what. (from pc guy of 20 years)

macOS has never suffered from DLL hell... Good, different ;)
o Lazarus v2.1.0 r63272, FPC v3.3.1 r45525, macOS 10.14.6 (with sup update), Xcode 11.3.1
o Lazarus v2.1.0 r61574, FPC v3.3.1 r42318, FreeBSD 12.1 (Parallels VM)
o FPC 3.0.4, FreeBSD 12-STABLE r358002
o Lazarus v2.1.0 r61574, FPC v3.0.4, Ubuntu 18.04 (Parallels VM)

 

TinyPortal © 2005-2018