'Resize IPython.display.Audio bar

Is there a way to resize the audio display bar in jupyter notebooks? For example, if I wanted the bar to be twice the width of its default. This would help scrubbing given a longer audio duration.

from IPython import display
audio_path = "./data/audio.wav"
display.Audio(filename=audio_path)

enter image description here

We want to extend the size of the grey display to be the length of the red line drawn. Is this possible with IPython.display.Audio, or is there an alternative library that can do this?

Thank you for your help.



Solution 1:[1]

I found a workaround:

from IPython.display import HTML
audio_style = "<style>audio { margin-left: 35px; width: 1260px; }</style>"
display(HTML(audio_style))

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1