The relevant code is
(to_adapter,from_sox)=multiprocessing.Pipe()
sox_output=pysox.SocketOutput('output',[from_sox])
mp3=mp3Downloader(audio_url)
sox=pysox.CEffectsChain(istream=mp3.stream)
sox.add_effect(pysox.CEffect('channels',['1']))
sox.add_effect(pysox.CEffect('rate',['16k']))
sox.add_effect(pysox.CEffect('bits',['16']))
sox.add_effect(pysox.CEffect('type',['wav']))
sox.add_effect(sox_output)
class mp3Downloader(multiprocessing.Process,object):
"""Downloads an mp3 file and sends it through a pipe"""
def __init__(self,audio_url):
"""Sets up the pipe"""
super(mp3Downloader,self).__init__()
self.from_web,to_stream=multiprocessing.Pipe()
self.stream=pysox.CPysoxPipeStream(path=to_stream)
self.audio_url=audio_url
def run(self):
"""Downloads the audio and feeds it to the pipe"""
audio=requests.get(self.audio_url,stream=True)
for block in audio.iter_content(1024):
self.from_web.send(block)
This produces a segmentation fault. What can I do to remedy this?
Pete Bleackley
------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi
_______________________________________________ Sox-users mailing list Sox-users@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/sox-users