{"id":18376909,"url":"https://github.com/bbc/audio_waveform-ruby","last_synced_at":"2025-08-22T17:06:42.630Z","repository":{"id":43040650,"uuid":"13561115","full_name":"bbc/audio_waveform-ruby","owner":"bbc","description":"Ruby gem that provides access to audio waveform data files generated by audiowaveform","archived":false,"fork":false,"pushed_at":"2024-03-01T17:26:22.000Z","size":47,"stargazers_count":84,"open_issues_count":2,"forks_count":8,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-07-28T12:09:26.835Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://waveform.prototyping.bbc.co.uk","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbc.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-10-14T12:51:28.000Z","updated_at":"2025-05-09T19:28:48.000Z","dependencies_parsed_at":"2024-11-06T00:37:44.384Z","dependency_job_id":null,"html_url":"https://github.com/bbc/audio_waveform-ruby","commit_stats":{"total_commits":39,"total_committers":4,"mean_commits":9.75,"dds":"0.28205128205128205","last_synced_commit":"f992ca099540b73af857c4bb66f6c5b8a721a610"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/bbc/audio_waveform-ruby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Faudio_waveform-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Faudio_waveform-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Faudio_waveform-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Faudio_waveform-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbc","download_url":"https://codeload.github.com/bbc/audio_waveform-ruby/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Faudio_waveform-ruby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271672593,"owners_count":24800706,"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","status":"online","status_checked_at":"2025-08-22T02:00:08.480Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-06T00:25:22.876Z","updated_at":"2025-08-22T17:06:42.583Z","avatar_url":"https://github.com/bbc.png","language":"Ruby","readme":"# audio_waveform-ruby\n\n[![Gem Version](https://badge.fury.io/rb/audio_waveform-ruby.svg)](http://rubygems.org/gems/audio_waveform-ruby) [![Build Status](https://travis-ci.org/bbc/audio_waveform-ruby.svg?branch=master)](https://travis-ci.org/bbc/audio_waveform-ruby)\n\nThe audio_waveform-ruby gem provides a Ruby API for access to audio waveform data\nfiles generated by the [audiowaveform](https://github.com/bbc/audiowaveform) program.\n\nRefer to the [audiowaveform](https://github.com/bbc/audiowaveform) documentation for more information and [this page](https://github.com/bbc/audiowaveform/blob/master/doc/DataFormat.md) for file format details.\n\n## Installation\n\nTo install:\n\n    $ gem install audio_waveform-ruby\n\nor, if using bundler, add this line to your application's Gemfile:\n\n```ruby\ngem 'audio_waveform-ruby', :require =\u003e 'audio_waveform'\n```\n\nor, to use the latest code from the GitHub repository:\n\n```ruby\ngem 'audio_waveform-ruby', :require =\u003e 'audio_waveform',\n    :git =\u003e 'https://github.com/bbc/audio_waveform-ruby.git'\n```\n\nand run\n\n    $ bundle install\n\n## Usage\n\nTo use this Gem in your program, add:\n\n```ruby\nrequire 'audio_waveform'\n```\n\nThen, to load and use data from an existing waveform data file:\n\n```ruby\nwaveform = AudioWaveform::WaveformDataFile.new(filename: \"test.dat\")\n\nputs waveform.sample_rate       # Returns audio sample rate, in Hz\nputs waveform.bits              # Returns resolution of waveform data points\nputs waveform.samples_per_pixel # Returns waveform zoom level, in samples per pixel\nputs waveform.size              # Returns number of waveform data points\n\n(0...waveform.size).each do |i|\n  puts waveform.min_sample(i)   # Returns waveform minimum at index i\n  puts waveform.max_sample(i)   # Returns waveform maximum at index i\nend\n```\n\nTo generate a binary representation of a waveform data file:\n\n```ruby\nwaveform = AudioWaveform::WaveformDataFile.new(filename: \"test.dat\")\ndata = waveform.to_binary\n```\n\nTo save waveform data as a file in binary format:\n\n```ruby\nwaveform = AudioWaveform::WaveformDataFile.new(filename: \"test.dat\")\nwaveform.save_as_binary(\"output.dat\")\n```\n\nTo generate a JSON representation of a waveform data file:\n\n```ruby\nwaveform = AudioWaveform::WaveformDataFile.new(filename: \"test.dat\")\nwaveform.to_json\n```\n\nTo save waveform data as a file in JSON format:\n\n```ruby\nwaveform = AudioWaveform::WaveformDataFile.new(filename: \"test.dat\")\nwaveform.save_as_json(\"output.json\")\n```\n\nTo create a new waveform data file:\n\n```ruby\nwaveform = AudioWaveform::WaveformDataFile.new(\n    sample_rate: 44100,\n    samples_per_pixel: 512,\n    bits: 8\n)\n\nwaveform.append(-10, 10)\n        .append(-11, 11)\n        .append(-3, 3)\n# etc\n```\n\n## License\n\nSee COPYING for details.\n\n## Contributing\n\nIf you have a feature request or want to report a bug, we'd be happy to hear from you. Please either raise an [issue](https://github.com/bbcrd/audio_waveform-ruby/issues), or fork the project and send us a pull request.\n\n## Authors\n\nThis software was written by [Chris Needham](https://github.com/chrisn), chris.needham at bbc.co.uk.\n\n## Copyright\n\nCopyright 2020 British Broadcasting Corporation\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbc%2Faudio_waveform-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbc%2Faudio_waveform-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbc%2Faudio_waveform-ruby/lists"}