Skip to content

AlbertSuarez/weird-converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

54 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Weird converter

PyPI version Downloads Downloads Downloads
HitCount Python package codecov GitHub stars GitHub forks GitHub contributors

๐Ÿ”€ Strange combinations converter like from Audio to Image and Image to Audio

Installation

Install client via pip. Ideally, weird-converter is well supported for Python >= 3.7.

pip3 install weird-converter

Usage

Just run it like this:

weird_converter.audio_to_image('audio.wav')  # It only supports wav files, for now.
weird_converter.image_to_audio('image.jpg')

Future development

  • ๐ŸŽถ Support other input audio types.
  • ๐Ÿ“น Implement audio to video conversion (and the same other way around).
  • โญ๏ธ Implement custom transformations for getting different results.

Motivation

I know this tool is kind of strange and probably not very useful. However, I wanted to play with numpy and try to understand in a deeper way the amount of stuff that this library can do. That's why I ended up doing this project where I see a lot of progression with different future tweakments (as it is specified above).

Results

Audio to image

Image generation comes from a normalization of the audio values. The image will have higher dimensions as more information the audio has, like audio length or channels available.

From this fanfare audio to this image:

Fanfare image

Or from this empty audio, representing a silence, to this image:

Silent image

Image to Audio

Audio generation comes from a normalization to a 44,100 samples per second audio. The output length will be higher depending on the dimensions of the input image. As you could check, the results look very similar to an helicopter sound but it differs depending on the given image.

Church image

To this audio, where it's clear when the audio is playing the black background and the building pixels.

Black image

To this near empty audio and very uniform.

Development

Recommendations

Usage of virtualenv is recommended for package library / runtime isolation.

Installation

  1. Setup virtual environment

  2. Install dependencies

pip3 install -r requirements.lock
  1. Install locally
pip3 install .

Contributing

Suggestions, improvements, and enhancements are always welcome! If you have any issues, please do raise one in the Issues section. If you have an improvement, do file an issue to discuss the suggestion before creating a PR.

All ideas โ€“ no matter how outrageous โ€“ welcome!

Authors

License

Apache-2.0 ยฉ weird-converter