Skip to content

Handle wf (big) size: When the waveform is large, spectrogram doesn't show. #4

Description

@thorwhalen

When the waveform is large, spectrogram doesn't show (but the element will still play on double-click).

image

Data used:
Waveform had 38570094 samples. Over 44100 sample rate this corresponds to 14.5 minutes.

Need to handle more gracefully.
In python, we will choose default according to size, and raise meaningful error if spectrogram is asked for but too big wf.
But in JS, we need to handle more gracefully too (and possibly forward error message to python.

Code used:

def wfsr_js_obj(wf, sr=44100, chart_type='spectrogram', height=200, title='', **kwargs):
    audio_channel = {
        'chartType': chart_type,
        'type': 'audio',
        'buffer': wf,
        'sr': sr
    }
    return single_time_vis(audio_channel, 
                           bt=0, 
                           tt=int(1e6) * len(wf) / sr, 
                           height=height, 
                           title=title, 
                           **kwargs)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or requestlow_priorityTO denote when an issue has low prioritytime-vis

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions