britalmeida / push_to_talk

Add-on for recording audio in Blender's Sequencer
GNU General Public License v3.0
49 stars 11 forks source link

macOS: record using native tools #6

Open fsiddi opened 4 years ago

fsiddi commented 4 years ago

Here is an AppleScript that could be used to record audio using QuickTime instead of FFmpeg.

on run argv

    set startStop to item 1 of argv

    if startStop = "start" then
        tell application "QuickTime Player"
            set newAudioRecording to new audio recording
            tell newAudioRecording
                start
            end tell
        end tell
    else
        set thePackagePath to POSIX path of "/tmp/NewAudio.qtpxcomposition/"
        tell application "QuickTime Player"
            stop document 1 -- to stop capture
            delay 1
            set thePackageFile to (thePackagePath as POSIX file)
            save document 1 in thePackageFile
            quit
        end tell

        set theAudio to POSIX path of thePackagePath & "Audio Recording.m4a"
    end if
end run

run with

osascript /path/to/script.scpt {start, stop}
enzyme69 commented 3 years ago

Is this something that will change the whole system? Or it's only temporary / once every time restart?

fsiddi commented 3 years ago

This is just a proof of concept, and it is a localized change.

pentabi commented 2 years ago

how do you exactly incorporate this for the add-on? I have no programming experience or anything and I just want to record my voice in blender but it's so hard.

fsiddi commented 2 years ago

Incorporating this script requires programming experience, and it's not an ideal solution. I recommend you to record your audio with a dedicated software.