Segmentation fault transcoding mp3 to wav using pysox

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm trying to transcribe a podcast. To do this, I'm streaming mp3 from the web, and transcoding it to wav with pysox before piping the transcoded audio to the speech recognition component. My sox installation is the latest version, built from source on AWS, and with the LAME and Wavpack libraries included (also built from source).

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

[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux