{"id":13500199,"url":"https://github.com/LeviBorodenko/spectrographic","last_synced_at":"2025-03-29T05:33:23.872Z","repository":{"id":37617130,"uuid":"229615352","full_name":"LeviBorodenko/spectrographic","owner":"LeviBorodenko","description":"Turn an image into sound whose spectrogram looks like the image. ","archived":false,"fork":false,"pushed_at":"2022-12-08T03:21:10.000Z","size":5769,"stargazers_count":260,"open_issues_count":7,"forks_count":28,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-10-01T17:19:38.958Z","etag":null,"topics":["audio-processing","audio-visualizer","frequencies","image-processing","image-to-sound","python","sound","sound-processing","sound-synthesis","spectrogram"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LeviBorodenko.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-22T18:54:04.000Z","updated_at":"2024-09-12T13:19:54.000Z","dependencies_parsed_at":"2023-01-24T08:15:13.851Z","dependency_job_id":null,"html_url":"https://github.com/LeviBorodenko/spectrographic","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeviBorodenko%2Fspectrographic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeviBorodenko%2Fspectrographic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeviBorodenko%2Fspectrographic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeviBorodenko%2Fspectrographic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LeviBorodenko","download_url":"https://codeload.github.com/LeviBorodenko/spectrographic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":222465911,"owners_count":16989106,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio-processing","audio-visualizer","frequencies","image-processing","image-to-sound","python","sound","sound-processing","sound-synthesis","spectrogram"],"created_at":"2024-07-31T22:00:53.073Z","updated_at":"2024-10-31T18:31:52.839Z","avatar_url":"https://github.com/LeviBorodenko.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# SpectroGraphic\n_Turn any image into a sound whose spectrogram looks like the image!_\n\n![result](banner.png)\n\n\u003chr\u003e\n\n#### What is this?\n\nMost sounds are intricate combinations of many acoustic waves each having different frequencies and intensities. A spectrogram is a way to represent sound by plotting time on the horizontal axis and the frequency spectrum on the vertical axis. Sort of like sheet music on steroids.\n\nWhat this tool does is, taking an image and simply interpreting it as a spectrogram. Therefore, by generating the corresponding sound, we have embedded our image in a spectrogram.\n\nThe game DOOM used a similar technique to [hide satanic figures inside its soundtrack](https://www.theverge.com/2016/5/31/11825606/doom-2016-soundtrack-satan-666-inverted-pentagram). Now everyone can do the same! 😊\n\n#### Set-up\n\nGet the command-line tool `spectrographic` via `pip` by running `pip install spectrographic`. You can also simply use `spectrographic.py` from `stand-alone\\` as a command-line tool directly.\nFurthermore, make sure you meet all the dependencies inside the `requirements.txt`. Install them with `pip install requirements.txt`.\n\nAfter installation with `pip` one simply needs to run `spectrographic [...]` in the console and with the stand-alone script you have to use `python spectrographic.py [...]` inside the folder containing `spectrographic.py`.\n\nYou could also simply import the `SpectroGraphic` class from `spectrographic.base`. Check the doc-strings for detailed explanations and more features.\n\n#### Command-line tool usage\n```\nusage: spectrographic [-h] [--version] -i PATH_TO_IMAGE [-d DURATION] [-m MIN_FREQ] [-M MAX_FREQ] [-r RESOLUTION] [-c CONTRAST] [-p] [-s SAVE_FILE]\n\nTurn any image into sound.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --version             show program's version number and exit\n  -i PATH_TO_IMAGE, --image PATH_TO_IMAGE\n                        Path of image that we want to embed in a spectrogram.\n  -d DURATION, --duration DURATION\n                        Duration of generated sound.\n  -m MIN_FREQ, --min_freq MIN_FREQ\n                        Smallest frequency used for drawing the image.\n  -M MAX_FREQ, --max_freq MAX_FREQ\n                        Largest frequency used for drawing the image.\n  -r RESOLUTION, --resolution RESOLUTION\n                        Vertical resolution of the image in the spectrogram.\n  -c CONTRAST, --contrast CONTRAST\n                        Contrast of the image in the spectrogram.\n  -p, --play            Directly play the resulting sound.\n  -s SAVE_FILE, --save SAVE_FILE\n                        Path to .wav file in which to save the resulting sound.\n```\nThus, if you have the source image at `./source.png` and you want to generate a 10s long sound in the frequency range of 10kHz to 20kHz. You also want to save the resulting .wav-file as `sound.wav` and also play the resulting sound. Then you need to run:\n\n`spectrographic --image ./source.png --min_freq 10000 --max_freq 20000 --duration 10 --save sound.wav --play`\n\nor if you are using the stand-alone script:\n\n`python spectrographic.py --image ./source.png --min_freq 10000 --max_freq 20000 --duration 10 --save sound.wav --play`\n\n#### Contribute\n\nBug reports, fixes and additional features are always welcome! Make sure to run the tests with `python setup.py test` and write your own for new features. Thanks.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLeviBorodenko%2Fspectrographic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLeviBorodenko%2Fspectrographic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLeviBorodenko%2Fspectrographic/lists"}