Pyaudio How to get sound on only one speaker

后端 未结 4 937
误落风尘
误落风尘 2020-12-21 13:13

I\'m using pyaudio in a school project and I\'m trying to get the sound to play on only one speaker at a time. My code is like this:

import pyaudio

p = pyau         


        
4条回答
  •  青春惊慌失措
    2020-12-21 13:40

    Right now you are using channels=1, i.e., a mono audio stream. You need to use two channels for stereo and generate the data for the left and right channel separately.

    Here's a short tutorial on how to create stereo data.

提交回复
热议问题