Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9bbb27dd authored by Phil Burk's avatar Phil Burk Committed by android-build-merger
Browse files

aaudio examples: Add deviceId option to examples

am: e008d02a

Change-Id: If8813014111fd19e03ac95ed2013cf313b970ecc
parents 8ec71590 e008d02a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ int main(int argc, const char **argv)
    // in a buffer if we hang or crash.
    setvbuf(stdout, nullptr, _IONBF, (size_t) 0);

    printf("%s - Monitor input level using AAudio V0.1.1\n", argv[0]);
    printf("%s - Monitor input level using AAudio read, V0.1.2\n", argv[0]);

    argParser.setFormat(REQUIRED_FORMAT);
    if (argParser.parseArgs(argc, argv)) {
+1 −1
Original line number Diff line number Diff line
@@ -41,7 +41,7 @@ int main(int argc, char **argv)
    // Make printf print immediately so that debug info is not stuck
    // in a buffer if we hang or crash.
    setvbuf(stdout, nullptr, _IONBF, (size_t) 0);
    printf("%s - Display audio input using an AAudio callback\n", argv[0]);
    printf("%s - Display audio input using an AAudio callback, V0.1.2\n", argv[0]);

    result = recorder.open(2, 48000, AAUDIO_FORMAT_PCM_I16,
                       SimpleRecorderDataCallbackProc, SimpleRecorderErrorCallbackProc, &myData);
+5 −1
Original line number Diff line number Diff line
@@ -150,6 +150,9 @@ public:
                    setChannelCount(atoi(&arg[2]));
                    break;
                case 'd':
                    setDeviceId(atoi(&arg[2]));
                    break;
                case 's':
                    mDurationSeconds = atoi(&arg[2]);
                    break;
                case 'm': {
@@ -202,7 +205,8 @@ public:
        printf("      Default values are UNSPECIFIED unless otherwise stated.\n");
        printf("      -b{bufferCapacity} frames\n");
        printf("      -c{channels} for example 2 for stereo\n");
        printf("      -d{duration} in seconds, default is %d\n", DEFAULT_DURATION_SECONDS);
        printf("      -d{deviceId} default is %d\n", AAUDIO_UNSPECIFIED);
        printf("      -s{duration} in seconds, default is %d\n", DEFAULT_DURATION_SECONDS);
        printf("      -m{0|1|2|3} set MMAP policy\n");
        printf("          0 = _UNSPECIFIED, default\n");
        printf("          1 = _NEVER\n");
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ int main(int argc, const char **argv)
    // in a buffer if we hang or crash.
    setvbuf(stdout, nullptr, _IONBF, (size_t) 0);

    printf("%s - Play a sine wave using AAudio V0.1.1\n", argv[0]);
    printf("%s - Play a sine wave using AAudio V0.1.2\n", argv[0]);

    if (argParser.parseArgs(argc, argv)) {
        return EXIT_FAILURE;
+1 −1
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ int main(int argc, const char **argv)
    // in a buffer if we hang or crash.
    setvbuf(stdout, nullptr, _IONBF, (size_t) 0);

    printf("%s - Play a sine sweep using an AAudio callback V0.1.2\n", argv[0]);
    printf("%s - Play a sine sweep using an AAudio callback V0.1.3\n", argv[0]);

    myData.schedulerChecked = false;
    myData.forceUnderruns = false; // set true to test AAudioStream_getXRunCount()