Как я могу слышать аудио разных видео на моем компьютере?

333
Yokhen

Я читаю эту книгу и до сих пор, находясь в главе 3, понимаю, что мультипрограммирование и многопроцессорность позволяют быстрее выполнять несколько существующих процессов / потоков. Я читаю все их тонкости и пока все прекрасно понимаю. Однако также упоминается, что, хотя программа использует модули ввода / вывода, другая программа должна ожидать, что означает, что две программы не могут использовать модули ввода / вывода одновременно.

Возможно, я спрашиваю слишком рано, и об этом говорится где-то позже в книге, но прямо сейчас - в этот момент - я не могу не задаться вопросом, как я могу иметь, скажем, VLC media player и Windows Media Player, воспроизводящие, каждый по-разному видео на мой компьютер и все же звук должен быть комбинацией звука обоих видео. Возможно ли, что выполнение процессов в I / O также имеет своего рода таймер? Или, может быть, мой компьютер имеет несколько модулей ввода / вывода (в данном случае аудио / динамик)? Если так, есть ли предел? Есть ли где-то в этой книге, на что я могу ненадолго запрыгнуть, чтобы почитать? Или, может быть, какой-то сайт, который объясняет это?

0

2 ответа на вопрос

2
David Schwartz

There are multiple software modules that feed into the software mixer module that feeds the hardware. Each application keeps a queue of sound data non-empty as the mixer module combines the inputs to produce a single output that drives the hardware.

Где-нибудь, где я могу прочитать больше об этом? Yokhen 9 лет назад 0
2
Frank Thomas

There are a few things to consider. first note that analog audio is different than digital audio which is usually streamed at a bitrate of 48khz (analog bitrate is theoretically infinite). if you looked at it with greater frequency (like maybe 1Mhz), you would see "holes" between the bits, and you can use the time to do other things, like processing a second stream.

Second note that the southbridge handles audio codec processing, so the stream doesn't need to pass the entire length of the system bus. between the southbridge and the sound card itself, a lot of the processing is done close to the source bus (the superIO controller)

Third note that the southbridge has multiple connections to the SuperIO controller, and the bus between them (in modern computing) is measured in GHz, as is the Sata bitrate.

Fourth, note that streams are a continuous phenomena, so a thread reading a stream from disk doesn't "complete" in time that it could then yield execution to another thread in a synchronous manner. in this case input is buffered while other threads are executing, if the system can't provide an execution unit to the thread continuously. the system has to be able to time-slice them, or a single core system could never play a sound file. That said though, the CPU doesn't do much with audio processing.

HD audio at high bitrates can stress system buses, and present issues with multithreading while maintaining smooth playback. Windows Vista+ throttle other southbridge stream services like the network card to ensure smooth playback, but a well provisioned system without signifigant load would have little trouble rendering a couple streams seemingly simultaneously.

so, all told, even if your system was limited on IO modules, the audio is slow enough to time-slice, relies on hardware and buses grouped together to avoid bottle necks with other system components, and doesn't stress the actual IO channel.

Насколько я знаю, это имело большой смысл. Спасибо! Yokhen 9 лет назад 0

Похожие вопросы