question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reading wave from memory

See original GitHub issue

There is a fork of audioreader that can read a wave file directly from memory like here https://github.com/jksinton/littlesleeper2/blob/master/littlesleeper.py#L453

So like

print "Processing MP3 queue buffer\n"
        # this is essentially a while-true loop
        for mp3data, timestamp in StreamBufferReader(self.queue_read):
            t1 = time.time() # start time used to calculate loop processing time below

            signaldata = None
            timestamp_str = timestamp.strftime("%Y-%m-%d %H:%M:%S.%f")
            try:
                signaldata = audioread.decode(StringIO(mp3data))
            except (audioread.NoBackendError, audioread.ffdec.ReadTimeoutError):
                print timestamp_str,"\tDecode error. Setting default value."

It is it possible to add a new interface to librosa.open to support this streaming mode? See here about this https://github.com/beetbox/audioread/issues/53

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
bmcfeecommented, Apr 17, 2019

Thanks for noting this.

Since #845 (and merging #847) , we’re deprioritizing audioread backends (and hope to drop it entirely at some point). Soundfile already supports this kind of streaming directly, and we have documentation illustrating how to do it here, so I don’t see a real need for adding this functionality. Unless I’m misunderstanding your comment?

1reaction
loretoparisicommented, Apr 18, 2019

@bmcfee yes of course due to patents issues it makes sense. Okay thank you I think using soundfile it is enough for this issue, thank you. The mp3 decoding to wav can be done in a different way.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to play WAV data right from memory? - python
I suppose you are using the wave library, right? The docs say: wave.open(file[, mode]). If file is a string, open the file by...
Read more >
Reading a large .wav file - Google Groups
I'm trying to read a large .wav file (35 minutes long, 1.12Gb, sample rate 96000 Hz, ... Reached total allocation of 8072Mb: see...
Read more >
How brain waves guide memory formation | MIT News
A new study from MIT neuroscientists finds that neurons hum at different frequencies to tell the brain which memories it should store.
Read more >
Wave: Memory - YouTube
Understanding the Wave memory for steno notes and timestamps• Memory Size in Strokes and Pages• Memory indicator on the display screen• What ...
Read more >
wave — Read and write WAV files — Python 3.11.1 ...
Source code: Lib/wave.py The wave module provides a convenient interface to the WAV sound format. Only files using WAVE_FORMAT_PCM are supported.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found