{"id":20690816,"url":"https://github.com/lemol/audiohs","last_synced_at":"2026-04-22T01:01:32.489Z","repository":{"id":13125578,"uuid":"15807515","full_name":"lemol/audiohs","owner":"lemol","description":"A library for play and record audio in haskell.","archived":false,"fork":false,"pushed_at":"2014-01-13T01:12:30.000Z","size":188,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-17T17:17:07.820Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Haskell","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/lemol.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-01-10T19:33:36.000Z","updated_at":"2019-12-06T00:17:49.000Z","dependencies_parsed_at":"2022-08-28T22:30:51.957Z","dependency_job_id":null,"html_url":"https://github.com/lemol/audiohs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemol%2Faudiohs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemol%2Faudiohs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemol%2Faudiohs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lemol%2Faudiohs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lemol","download_url":"https://codeload.github.com/lemol/audiohs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242952480,"owners_count":20211831,"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":[],"created_at":"2024-11-16T23:14:28.759Z","updated_at":"2025-12-24T01:40:31.369Z","avatar_url":"https://github.com/lemol.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"Audiohs\n=======\n\nProvides functions for easily play and record sounds in haskell. It uses `Data.Vector Float` as array type.\n\nInstall\n-------\n\nAt background this package uses the cross platform [PortAudio] [portaudio-lib] library to play and record sounds, so first the portaudio bindings [portaudio] [portaudio-package] for haskell must be installed. See [here] [portaudio-package] for instructions.\n\n1. Install [portaudio][portaudio-package] bindings\n\n```shell\ncabal install portaudio\n```\n\n2. Download [the lastest version of audiohs] [hsaudio-master] and install it:\n\n```shell\ngit clone https://github.com/lemol/audiohs.git\ncd hsaudio\ncabal install\n```\n\nUsage\n-----\n\nJust import `Sound.Audio(play, record)` and use the functions:\n\n```haskell\nplay   :: Double -\u003e Vector Float -\u003e IO ()\nplay fs x\n\nrecord :: Int -\u003e Double -\u003e Vector Float\nx \u003c- record count fs\n```\n\nExamples\n--------\n\n1. Playing a 3 seconds 440 Hz tone.\n\n```haskell\nimport Sound.Audio (play)\nimport qualified Data.Vector as V\n\nfs :: Double\nfs = 44100\n\nsineWave :: V.Vector Float\nsineWave = V.fromList $ map sinList [0..3*fs'-1]\n\twhere\n\t\tsinList = sin . (2 * 440 * pi/fs' *)\n\t\tfs'     = realToFrac fs\n\nmain :: IO ()\nmain = play fs sineWave\n```\n\n2. Record for 5 seconds and play the result.\n\n```haskell\nimport Sound.Audio (play, record)\n\nfs :: Double\nfs = 44100\n\nmain :: IO ()\nmain = do\n\tx \u003c- record (5*44100) fs\n\tplay fs x\n```\n\nOr, even better:\n\n```haskell\nmain = record (5*44100) fs \u003e\u003e= play fs\n```\n\nLicense\n-------\n(c) 2014 Leza Morais Lutonda (Lemol-C)   \n[MIT License] [lemolsoft-mit-license]\n\nContribuitions\n--------------\nCritiques, suggestion, pull request, etc. all are wellcome!\n\nCredits\n-------\nThis package is thanks to the [portaudio][portaudio-package] bindings for haskell.\n\n[portaudio-lib]: http://portaudio.com/\n[portaudio-package]: http://hackage.haskell.org/package/portaudio\n[lemolsoft-mit-license]: http://lemolsoft.mit-license.org/\n[hsaudio-master]: https://github.com/lemol/audiohs/archive/master.zip\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemol%2Faudiohs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flemol%2Faudiohs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemol%2Faudiohs/lists"}