9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* macOS drawterm audio
@ 2020-03-31 19:32 clueelf
  2020-04-12  3:20 ` [9fans] " clueelf
  0 siblings, 1 reply; 2+ messages in thread
From: clueelf @ 2020-03-31 19:32 UTC (permalink / raw)
  To: 9fans

All,

Wanted to reach out before I started doing any work on this, but does anyone have existing code for a devaudio-macos.c for drawterm? I see win32 and unix have working audio.  

If anyone has something out there they have started that I can use, would be greatly appreciated.   I am willing to take a stab at it, but just wanted to check before I went down this rabbit hole.  If not... I think I can bang it out.  Doesn't seem too difficult. 

I need audio!

Tony


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [9fans] macOS drawterm audio
  2020-03-31 19:32 macOS drawterm audio clueelf
@ 2020-04-12  3:20 ` clueelf
  0 siblings, 0 replies; 2+ messages in thread
From: clueelf @ 2020-04-12  3:20 UTC (permalink / raw)
  To: 9fans

So I got this working.  My work is in a forked repo on github.  I created a new branch named macos-audio

https://github.com/tmendoza/drawterm-macos-audio/tree/macos-audio

As of right now, it builds on my machine just fine:

macOS Mojave
Version 10.14.6

(base) apollo:drawterm-macos-audio tmendoza$ clang -v
Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin18.7.0

Darwin apollo.local 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64

Audio playback is done using PortAudio.  Sorry, but I didn't have the desire to dig thru Apple's AUHAL API's.  Nope.  

To build properly, you can use Homebrew to install portaudio.  I am using VSCode for an IDE and it appears to have picked up libs and header
dirs.  Make.osx-cocoa was an easy update.

Note, I am by no means an expert Apple Developer, but it seems to be working pretty well.   Been playing WAV files all weekend.

I have also added volume control thru /dev/volume.  Any 'audio source' commands written to /dev/volume will modify the master volume on the OS.
Apple doesn't seem to have an API for per-application volume control, so whatever you write to /dev/volume (1-100) changes the entire system volume
for the machine.    Also, any changes made to the volume controls using standard OS tools or volume buttons on your laptop will be reflected when reading
/dev/volume.

If anyone tries this out and has issues let me know and I will try and resolve.  This was a weekend hack so your mileage may vary.

I am thinking about creating an official build for macOS.  If anyone is interested let me know and I can make it a priority.

Tony


On 3/31/2020 at 2:34 PM, clueelf@tonymendoza.us wrote:
>
>All,
>
>Wanted to reach out before I started doing any work on this, but 
>does anyone have existing code for a devaudio-macos.c for 
>drawterm? I see win32 and unix have working audio.  
>
>If anyone has something out there they have started that I can 
>use, would be greatly appreciated.   I am willing to take a stab 
>at it, but just wanted to check before I went down this rabbit 
>hole.  If not... I think I can bang it out.  Doesn't seem too 
>difficult. 
>
>I need audio!
>
>Tony
>
>
>------------------------------------------
>9fans: 9fans
>Permalink: 
>https://9fans.topicbox.com/groups/9fans/Tfe03295f479d4dad-
>M6ff0f0be4cf446bf5cd301fb
>Delivery options: 
>https://9fans.topicbox.com/groups/9fans/subscription


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-12  3:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-31 19:32 macOS drawterm audio clueelf
2020-04-12  3:20 ` [9fans] " clueelf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).