Skip to content

Commit

Permalink
updated coreaudio; added chance to set verbosity of server while init…
Browse files Browse the repository at this point in the history
…ialization
  • Loading branch information
Bibiko authored and belangeo committed Feb 15, 2023
1 parent 2ea3d44 commit e293699
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 105 deletions.
1 change: 1 addition & 0 deletions include/ad_coreaudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 22,7 @@
#define _AD_COREAUDIO_H

#include <CoreAudio/AudioHardware.h>
#include <CoreAudio/HostTime.h>
#include "servermodule.h"

OSStatus coreaudio_input_callback(AudioDeviceID device, const AudioTimeStamp* inNow,
Expand Down
3 changes: 3 additions & 0 deletions include/servermodule.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 30,7 @@ extern "C" {

#include "sndfile.h"
#include "pyomodule.h"
#include <CoreAudio/AudioHardware.h>

typedef enum
{
Expand Down Expand Up @@ -104,6 105,8 @@ typedef struct
int duplex;
int input;
int output;
AudioDeviceIOProcID outprocid;
AudioDeviceIOProcID inprocid;
int input_offset;
int output_offset;
int midi_input;
Expand Down
8 changes: 5 additions & 3 deletions pyo/lib/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 100,8 @@ class Server(object):
the user's responsability to manage the audio/midi configuration of its system.
User can set an environment variable named PYO_SERVER_MIDI to set this value globally.
verbosity: int, optional
Set the server's verbosity.
.. note::
The following methods must be called **before** booting the server
Expand Down Expand Up @@ -142,6 143,7 @@ def __init__(
ichnls=None,
winhost="directsound",
midi="portmidi",
verbosity=7,
):
if "PYO_SERVER_AUDIO" in os.environ and audio not in ["offline", "offline_nb", "embedded", "manual"]:
audio = os.environ["PYO_SERVER_AUDIO"]
Expand All @@ -159,7 161,7 @@ def __init__(
self._audio = audio
self._winhost = winhost
self._amp = 1.0
self._verbosity = 7
self._verbosity = verbosity
self._startoffset = 0
self._dur = -1
self._filename = None
Expand All @@ -168,7 170,7 @@ def __init__(
self._globalseed = 0
self._resampling = 1
self._isJackTransportSlave = False
self._server = Server_base(sr, nchnls, buffersize, duplex, audio, jackname, self._ichnls, midi)
self._server = Server_base(sr, nchnls, buffersize, duplex, audio, jackname, self._ichnls, midi, self._verbosity)
self._server._setDefaultRecPath(os.path.join(os.path.expanduser("~"), "pyo_rec.wav"))

if sys.platform.startswith("win"):
Expand Down
Loading

0 comments on commit e293699

Please sign in to comment.