Skip to content

Commit

Permalink
add devkit
Browse files Browse the repository at this point in the history
Signed-off-by: Lessica <82flex@gmail.com>
  • Loading branch information
Lessica committed Nov 15, 2024
1 parent 47c9fa7 commit 40431c4
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 16 deletions.
25 changes: 9 additions & 16 deletions cli/recorder.mm
Original file line number Diff line number Diff line change
Expand Up @@ -111,31 +111,24 @@ __used static void _CalculateDerivedBufferSize(AudioQueueRef audioQueue, AudioSt
__used static OSStatus _RecorderSetup(CFURLRef fileURL) {

OSStatus status = noErr;
UInt32 dataFormatSize = 0;
UInt32 *magicCookie = NULL;
UInt32 cookieSize = 0;

Float64 sampleRate = 0;
UInt32 numberOfChannels = 0;
AVAudioFormat *audioFormat = nil;

sampleRate = 44100.0;
numberOfChannels =
(mATAudioTapDescriptionPID == kATAudioTapDescriptionPIDMicrophone ? 1 : 2); // built-in mono microphone

mDataFormat.mFormatID = kAudioFormatMPEG4AAC;
mDataFormat.mSampleRate = sampleRate;
mDataFormat.mChannelsPerFrame = numberOfChannels;

dataFormatSize = sizeof(mDataFormat);

status = AudioFormatGetProperty(kAudioFormatProperty_FormatInfo, 0, NULL, &dataFormatSize, &mDataFormat);

if (status != noErr) {
NSLog(@"AudioFormatGetProperty (%d)", status);
return status;
audioFormat = [[AVAudioFormat alloc] initWithCommonFormat:AVAudioPCMFormatFloat32
sampleRate:44100.0
channels:(AVAudioChannelCount)numberOfChannels
interleaved:YES];
if (!audioFormat) {
NSLog(@"AVAudioFormat");
return -1;
}

mCurrentPacket = 0;
mDataFormat = *([audioFormat streamDescription]);

status = AudioQueueNewInput(&mDataFormat, _RecorderCallback, NULL, NULL, NULL, 0, &mQueueRef);

Expand Down
7 changes: 7 additions & 0 deletions devkit/env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

export THEOS=$HOME/theos
export THEOS_PACKAGE_SCHEME=
export THEOS_DEVICE_IP=127.0.0.1
export THEOS_DEVICE_PORT=58422
export THEOS_DEVICE_SIMULATOR=
7 changes: 7 additions & 0 deletions devkit/roothide.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

export THEOS=$HOME/theos-roothide
export THEOS_PACKAGE_SCHEME=roothide
export THEOS_DEVICE_IP=127.0.0.1
export THEOS_DEVICE_PORT=58422
export THEOS_DEVICE_SIMULATOR=
7 changes: 7 additions & 0 deletions devkit/rootless.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

export THEOS=$HOME/theos
export THEOS_PACKAGE_SCHEME=rootless
export THEOS_DEVICE_IP=127.0.0.1
export THEOS_DEVICE_PORT=58422
export THEOS_DEVICE_SIMULATOR=

0 comments on commit 40431c4

Please sign in to comment.