mirror of
https://github.com/microtherion/VocalEasel.git
synced 2024-12-22 11:14:00 +00:00
Implement sound out to file
This commit is contained in:
parent
5359a95757
commit
fbf53052e3
|
@ -10,11 +10,38 @@
|
||||||
#include "VLSoundOut.h"
|
#include "VLSoundOut.h"
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <CoreFoundation/CoreFoundation.h>
|
||||||
|
|
||||||
int main(int, char *const [])
|
int main(int argc, char *const argv[])
|
||||||
{
|
{
|
||||||
|
VLSoundOut * soundOut = NULL;
|
||||||
|
|
||||||
|
if (argc > 2) {
|
||||||
|
CFStringRef outFile =
|
||||||
|
CFStringCreateWithCString(NULL, argv[2], kCFStringEncodingUTF8);
|
||||||
|
CFURLRef outURL =
|
||||||
|
CFURLCreateWithFileSystemPath(NULL, outFile, kCFURLPOSIXPathStyle, false);
|
||||||
|
soundOut = VLSoundOut::FileWriter(outURL, 0);
|
||||||
|
CFRelease(outURL);
|
||||||
|
CFRelease(outFile);
|
||||||
|
} else {
|
||||||
|
soundOut = VLSoundOut::Instance();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (argc > 1) {
|
||||||
|
CFStringRef inFile =
|
||||||
|
CFStringCreateWithCString(NULL, argv[1], kCFStringEncodingUTF8);
|
||||||
|
CFURLRef inURL =
|
||||||
|
CFURLCreateWithFileSystemPath(NULL, inFile, kCFURLPOSIXPathStyle, false);
|
||||||
|
CFDataRef inData;
|
||||||
|
CFURLCreateDataAndPropertiesFromResource(NULL, inURL, &inData,
|
||||||
|
NULL, NULL, NULL);
|
||||||
|
soundOut->PlayFile(inData);
|
||||||
|
CFRelease(inData);
|
||||||
|
CFRelease(inURL);
|
||||||
|
CFRelease(inFile);
|
||||||
|
} else {
|
||||||
std::string chordName;
|
std::string chordName;
|
||||||
VLSoundOut * soundOut = VLSoundOut::Instance();
|
|
||||||
|
|
||||||
while (std::cin >> chordName) {
|
while (std::cin >> chordName) {
|
||||||
VLChord chord(chordName);
|
VLChord chord(chordName);
|
||||||
|
@ -23,6 +50,7 @@ int main(int, char *const [])
|
||||||
usleep(250*1000);
|
usleep(250*1000);
|
||||||
soundOut->PlayChord(chord);
|
soundOut->PlayChord(chord);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user