9 class Audio
: public PProcess
11 PCLASSINFO(Audio
, PProcess
)
16 PCREATE_PROCESS(Audio
)
20 cout
<< "Audio Test Program\n";
22 PSoundChannel::Directions dir
;
26 cout
<< "List of Play devices\n";
28 dir
= PSoundChannel::Player
;
29 names
= PSoundChannel::GetDeviceNames(dir
);
30 for (PINDEX i
= 0; i
< names
.GetSize(); i
++)
31 cout
<< " \"" << names
[i
] << "\"\n";
33 cout
<< "The default play device is \"" << PSoundChannel::GetDefaultDevice(dir
) << "\"\n";
37 cout
<< "List of Record devices\n";
39 dir
= PSoundChannel::Recorder
;
40 names
= PSoundChannel::GetDeviceNames(dir
);
41 for (PINDEX i
= 0; i
< names
.GetSize(); i
++)
42 cout
<< " \"" << names
[i
] << "\"\n";
44 cout
<< "The default record device is \"" << PSoundChannel::GetDefaultDevice(dir
) << "\"\n";
49 // Display the mixer settings for the default devices
51 dir
= PSoundChannel::Player
;
52 sound
.Open(PSoundChannel::GetDefaultDevice(dir
),dir
);
55 if (sound
.GetVolume(vol
))
56 cout
<< "Play volume is " << vol
<< endl
;
58 cout
<< "Play volume cannot be obtained" << endl
;
62 dir
= PSoundChannel::Recorder
;
63 sound
.Open(PSoundChannel::GetDefaultDevice(dir
),dir
);
65 if (sound
.GetVolume(vol
))
66 cout
<< "Record volume is " << vol
<< endl
;
68 cout
<< "Record volume cannot be obtained" << endl
;