Sounds like a job for loop back testing. Strictly speaking, loop back testing might feel as much like integration testing as it does like unit testing, even if the primary goal is to test just one particular device's support of configuration, input, and output.
For the audio device, perhaps you can do the following:
- Wire a physical loop back of output to input.
- Configure gains, sample rates, etc. as needed to insure functional and code coverage.
- Playback a data file A and capture it back as B.
- Compare A and B in some suitable way to determine pass/fail.
- Repeat with multiple data sets to cover valid and invalid test cases.
Similar approaches are possible with video and network loop backs.
A few additional suggestions:
- Use of lossy compression or noise may limit your ability to compare capture files.
- Use of simplified inputs like tones from frequency generators or and video from generated color bars might work better than a track from your favorite rock band and a clip from an action movie.
- You may want to play with the gain or run the samples through an FFT and compare the outputs of the FFT.
- If comparing content gets too hard, checking duration, or verifying by ear or eye might be a way to get 'er done without making test code that is more complicated that the production code.
Good luck. Hope this answer helps.