{"id":20947904,"url":"https://github.com/chip/popcap","last_synced_at":"2026-04-13T07:37:01.074Z","repository":{"id":24124236,"uuid":"27512842","full_name":"chip/popcap","owner":"chip","description":"A music cataloging tool with the ability to read \u0026 write metadata tags from and to an audio file.","archived":false,"fork":false,"pushed_at":"2013-07-14T14:13:09.000Z","size":428,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-01T00:52:47.282Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chip.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-03T23:22:31.000Z","updated_at":"2021-03-26T21:24:45.000Z","dependencies_parsed_at":"2022-08-24T20:52:11.157Z","dependency_job_id":null,"html_url":"https://github.com/chip/popcap","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chip/popcap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chip%2Fpopcap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chip%2Fpopcap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chip%2Fpopcap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chip%2Fpopcap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chip","download_url":"https://codeload.github.com/chip/popcap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chip%2Fpopcap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31744404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T06:26:45.479Z","status":"ssl_error","status_checked_at":"2026-04-13T06:26:44.645Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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-19T00:13:38.666Z","updated_at":"2026-04-13T07:37:01.042Z","avatar_url":"https://github.com/chip.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"PopCap\n======\n\nPopCap is an audio file management library.  It wraps some functionality from FFmpeg for reading \u0026 writing metadata tags, converting between audio file formats, and managing an audio file on the file system.\n\nGetting Started\n---------------\n\n```\ngem install popcap\nrequire 'popcap'\n\nSong = Class.new(PopCap::AudioFile)\nsong = Song.new('path/to/sample.flac')\n```\n\nRead Tags\n---------\n\nRead the metadata tags from an audio file.\n\n```\naudio_file = PopCap::AudioFile.new('sample.flac')\n\naudio_file.raw_output =\u003e Returns JSON for the raw output from \nrunning \"ffprobe -show_format -print_format json.\"\n\n      { \n        \"format\": \n          { \n            \"filename\":\"spec/fixtures/sample.flac\",\n            \"nb_streams\":1,\n            \"format_name\":\"flac\",\n            \"format_long_name\":\"raw FLAC\",\n            \"duration\":\"1.000000\",\n            \"size\":\"18291\",\n            \"bit_rate\":\"146328\",\n\n              \"tags\": \n              { \n                \"GENRE\":\"Sample Genre\",\n                \"track\":\"01\",\n                \"ALBUM\":\"Sample Album\",\n                \"DATE\":\"2012\",\n                \"TITLE\":\"Sample Title\",\n                \"ARTIST\":\"Sample Artist\" \n              }\n          }\n      }\n\naudio_file.unformatted =\u003e Returns a Ruby hash after sanitizing \nthe raw output of #raw_output.\n\n      {\n        filename: '$HOME/spec/fixtures/sample.flac',\n        nb_streams: 1,\n        format_name: 'flac',\n        format_long_name: 'raw FLAC',\n        duration: '1.000000',\n        filesize: '18291',\n        bit_rate: '146328',\n        genre: 'Sample Genre',\n        track: '01',\n        album: 'Sample Album',\n        date: '2012',\n        title: 'Sample Title',\n        artist: 'Sample Artist'\n      }\n\naudio_file.formatted =\u003e Returns a Ruby hash after sanitizing \nthe raw output of #raw_output.  It also applies internal formatters \non fields such as duration, bit_rate, filesize, \u0026 date,\nreturning human readable output.\n\n      {\n        filename: '$HOME/spec/fixtures/sample.flac',\n        nb_streams: 1,\n        format_name: 'flac',\n        format_long_name: 'raw FLAC',\n        duration: '1',\n        filesize: '17.9K',\n        bit_rate: '146 kb/s',\n        genre: 'Sample Genre',\n        track: '01',\n        album: 'Sample Album',\n        date: 2012,\n        title: 'Sample Title',\n        artist: 'Sample Artist'\n      }\n\naudio_file.tags =\u003e Returns a tag structure using the #formatted values.\n\n    .album             =\u003e  'Sample Album'\n    .artist            =\u003e  'Sample Artist'\n    .bit_rate          =\u003e  '146 kb/s'\n    .date              =\u003e  2012\n    .duration          =\u003e  '1'\n    .filename          =\u003e  ''$HOME/spec/fixtures/sample.flac'\n    .filesize          =\u003e  '17.9K'\n    .format_long_name  =\u003e  'raw FLAC'\n    .format_name       =\u003e  'flac'\n    .genre             =\u003e  'Sample Genre'\n    .nb_streams        =\u003e  1\n    .start_time        =\u003e  'N/A'\n    .title             =\u003e  'Sample Title'\n    .track             =\u003e  '01'\n\naudio_file.reload! =\u003e Reload an instance of itself, \nuseful when updating tags.  This behavior is built in, \nbut will need to be called manually in certain situations; \n(such as moving a file on the file system, deleting a file, etc.)\n```\n\nUpdate Tags\n-----------\n\nThis will update the metadata tags for an audio file.  \nIt will also dynamically add any newly provided tags.  \nIt takes a hash of attributes.\n\n```\naudio_file = PopCap::AudioFile.new('sample.flac')\naudio_file.update(artist: 'David Bowie')\n\naudio_file.update(fancy_new_tag: 'Custom Tag Input')\n```\n\nConvert\n-------\n\nThis will convert between audio file formats.  \nIt is restricted to basic audio formats.  \nIt also takes an optional bitrate for mp3 formats.  \nThe original file is preserved during the conversion.\n\n```\naudio_file = PopCap::AudioFile.new('sample.flac')\n\naudio_file.convert(:ogg)\naudio_file.convert(:mp3) # =\u003e default bitrate is 192k\naudio_file.convert(:mp3, 256)\n```\n\nFile Management Options\n-----------------------\n\nVarious Ruby File \u0026 FileUtils methods are wrapped for convenience.\n\n```\naudio_file = PopCap::AudioFile.new('sample.flac')\n\naudio_file.backup # =\u003e default directory is '/tmp'\naudio_file.backup('some/path')\n\naudio_file.backup_path # =\u003e returns backup path\n\naudio_file.destroy # =\u003e removes file from filesystem\n\naudio_file.directory # =\u003e returns directory, excluding filename\n\naudio_file.filename # =\u003e returns filename, excluding directory\n\naudio_file.move('destination') # = \u003e moves file to destination\n\naudio_file.rename('new_name.flac') # =\u003e renames file\n\naudio_file.restore # =\u003e restores file from backup_path; \n                        takes an optional path\n\naudio_file.tmppath # =\u003e returns the temporary path, e.g. '/tmp/sample.flac'\n```\n\nDependencies\n------------\nRuby 2.0+\n\n[FFmpeg](http://ffmpeg.org)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchip%2Fpopcap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchip%2Fpopcap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchip%2Fpopcap/lists"}