
{"id":9873,"date":"2022-06-21T09:10:27","date_gmt":"2022-06-21T09:10:27","guid":{"rendered":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/documentation\/rdk_video_documentation\/components\/open-sourced_components\/audiocapturemgr\/"},"modified":"2025-03-25T05:18:35","modified_gmt":"2025-03-25T05:18:35","slug":"audiocapturemgr","status":"publish","type":"page","link":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/audiocapturemgr\/","title":{"rendered":"audiocapturemgr"},"content":{"rendered":"<p><!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\"><br \/>\n<html><body><\/p>\n<div class=\"toc-macro client-side-toc-macro  conf-macro output-block\" data-headerelements=\"H1,H2,H3,H4,H5,H6,H7\" data-hasbody=\"false\" data-macro-name=\"toc\"><\/div>\n<h3 class=\"wp-sub-header\">Overview<\/h3>\n<ul>\n<li class=\"RepoDescription\">Audio capture manager presents the audio data to registered applications.<\/li>\n<li class=\"RepoDescription\">Supports creation of audio clips from currently streaming content.&nbsp;<\/li>\n<li>Creates clips of audio from content currently viewing so that it can be used for song identification service.<\/li>\n<li>The <a href=\"https:\/\/wiki.rdkcentral.com\/display\/RDK\/Data+Capture\" rel=\"nofollow\">Data Capture Service Manager API<\/a> is used to create audio clip and post\/stream to Music ID server (specified URL.)<\/li>\n<li>When Service Manager API is called to create audio clip, settop creates audio clip of specified duration.<\/li>\n<\/ul>\n<h3 class=\"wp-sub-header\">Data Flow<\/h3>\n<ul>\n<li>At startup, app calls <a href=\"https:\/\/wiki.rdkcentral.com\/display\/RDK\/Data+Capture\" rel=\"nofollow\">org.rdk.dataCapture_1.enableAudioCapture<\/a> api to create pre-capture audio buffer and starts buffering primary audio stream.<\/li>\n<li>App makes request for audio clip capture by passing following parameters:<\/li>\n<li>Destination URL and application parameters for Music ID service<\/li>\n<li>Length of clip capture<\/li>\n<li>Primary or secondary audio. (Note: Only primary audio is continuously captured)<\/li>\n<li>Send pre-captured data, or post-capture (capture starts after app makes request). Majority of requests will be for pre-captured data, where entire clip is already captured by the time call is made.<\/li>\n<li>App calls Service Manager API <a href=\"https:\/\/wiki.rdkcentral.com\/display\/RDK\/Data+Capture\" rel=\"nofollow\">org.rdk.dataCapture_1.getAudioClip<\/a> and passes the request<\/li>\n<\/ul>\n<div class=\"code panel pdl conf-macro output-block\" data-hasbody=\"true\" data-macro-name=\"code\">\n<div class=\"codeContent panelContent pdl\">\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">{\n\"stream\" : &ldquo;primary&rdquo;\n\"url\" : \"http:\/\/&lt;musicid_server\/analyze?trx=83cf6049-b722-4c44-b92e-79a504ae8f85:1458580048400&amp;codec=PCM_16_16K&amp;deviceId=5082732351093257712\",\n\"duration\" : 6\n\"captureMode\" : &ldquo;preCapture&rdquo;\n}<\/pre>\n<\/div>\n<\/div>\n<ul>\n<li>Service Manager stores url and then calls IARMBUS_AUDIOCAPTUREMGR_REQUEST_SAMPLE which is handled in audiocapturemgr.<\/li>\n<li>ACM (using audio driver api&#8217;s) extracts the data based on specified length in seconds,\n<ul>\n<li>the content must be raw binary data captured from PCM output<\/li>\n<li>packages data in a pcm file, and<\/li>\n<li>sends IARM event to Service Manager.<\/li>\n<\/ul>\n<ul class=\"alternate\">\n<li>\n<ul class=\"alternate\">\n<li>Name of event: DATA_CAPTURE_IARM_EVENT_AUDIO_CLIP_READY.<\/li>\n<li>Associated data: file or html locator is sent with event.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<ul>\n<li>Service Manager takes the audio clip file, formats the curl message and sends the file to URL pointing to Music ID service.<\/li>\n<\/ul>\n<div class=\"code panel pdl conf-macro output-block\" data-hasbody=\"true\" data-macro-name=\"code\">\n<div class=\"codeContent panelContent pdl\">\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">curl -H \"Content-Type: application\/x-wav\" --trace-ascii debugdump.txt --data-binary @AudioClip_6.wav '&lt;media_service_url&gt;&amp;codec=PCM_16_16K&amp;deviceId=&lt;device ID&gt;'<\/pre>\n<\/div>\n<\/div>\n<ul>\n<li>Service Manager logs the capture event<\/li>\n<li>Service Manager logs the response from Music ID service.<\/li>\n<\/ul>\n<h3 class=\"wp-sub-header\">Test Case Using Test App CLI Interface<\/h3>\n<p>Ensure that SDK support is enabled for audiocapture.<\/p>\n<ol>\n<li>Confirm the presence of \/usr\/bin\/audiocapturemgrtestapp<\/li>\n<li>Launch \/usr\/bin\/audiocapturemgrtestapp and verify that you get a CLI menu<\/li>\n<li>Select option set precapture length.<\/li>\n<li>Provide 3 as the value and press enter.<\/li>\n<li>Select option Start client.<\/li>\n<li>Wait 3 seconds and then select dump precaptured sample. The console will indicate the name and path of the file being written. Note this down and and the precapture length you set (3).<\/li>\n<li>Select capture next N seconds. Enter 10 for length and press enter. The console will indicate the name and path of the file being written. Note this down and the length you entered just now.<\/li>\n<li>Wait 11 seconds.<\/li>\n<li>Select Stop client.<\/li>\n<li>Select Quit.<\/li>\n<li>Copy the dumped files to a PC and verify that they&#8217;re playable.<\/li>\n<li>Verify that the duration of these sound clips match the number that you logged against them when conducting the test.<\/li>\n<li>Delete all the .wav files created in \/opt\/ by the test application.<\/li>\n<\/ol>\n<p>Note: the precaptured sample files have the following pattern: \/opt\/precap-*.wav.<br \/>\nThe sound samples captured using capture next N seconds option will have the following filename pattern: \/opt\/\/opt\/freshcap-*.wav.<\/p>\n<h3 class=\"wp-sub-header\">API Documentation<\/h3>\n<p>To see the List of APIs supported by audiocapturemgr, Please see <a href=\"https:\/\/wiki.rdkcentral.com\/doxygen\/rdkv-opensourced\/d1\/d76\/group___a_u_d_i_o___c_a_p_t_u_r_e___m_a_n_a_g_e_r___a_p_i.html\" rel=\"nofollow\">Audiocapturemgr API Documentation<\/a><\/p>\n<p><\/body><\/html><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Overview Audio capture manager presents the audio data to registered applications. Supports creation of audio [&hellip;]<\/p>\n","protected":false},"author":28,"featured_media":0,"parent":9844,"menu_order":4,"comment_status":"open","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"class_list":["post-9873","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>audiocapturemgr - RDK Documentation Portal | Documentation<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/audiocapturemgr\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"audiocapturemgr - RDK Documentation Portal | Documentation\" \/>\n<meta property=\"og:description\" content=\"Overview Audio capture manager presents the audio data to registered applications. Supports creation of audio [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/audiocapturemgr\/\" \/>\n<meta property=\"og:site_name\" content=\"RDK Documentation Portal | Documentation\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-25T05:18:35+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/audiocapturemgr\/\",\"url\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/audiocapturemgr\/\",\"name\":\"audiocapturemgr - RDK Documentation Portal | Documentation\",\"isPartOf\":{\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/#website\"},\"datePublished\":\"2022-06-21T09:10:27+00:00\",\"dateModified\":\"2025-03-25T05:18:35+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/audiocapturemgr\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/audiocapturemgr\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/audiocapturemgr\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Documentation\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"RDK Entertainment\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Components\",\"item\":\"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"audiocapturemgr\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/developer.rdkcentral.com\/documentation\/#website\",\"url\":\"https:\/\/developer.rdkcentral.com\/documentation\/\",\"name\":\"RDK Documentation Portal | Documentation\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/developer.rdkcentral.com\/documentation\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"audiocapturemgr - RDK Documentation Portal | Documentation","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/audiocapturemgr\/","og_locale":"en_US","og_type":"article","og_title":"audiocapturemgr - RDK Documentation Portal | Documentation","og_description":"Overview Audio capture manager presents the audio data to registered applications. Supports creation of audio [&hellip;]","og_url":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/audiocapturemgr\/","og_site_name":"RDK Documentation Portal | Documentation","article_modified_time":"2025-03-25T05:18:35+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/audiocapturemgr\/","url":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/audiocapturemgr\/","name":"audiocapturemgr - RDK Documentation Portal | Documentation","isPartOf":{"@id":"https:\/\/developer.rdkcentral.com\/documentation\/#website"},"datePublished":"2022-06-21T09:10:27+00:00","dateModified":"2025-03-25T05:18:35+00:00","breadcrumb":{"@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/audiocapturemgr\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/audiocapturemgr\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/audiocapturemgr\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/developer.rdkcentral.com\/documentation\/"},{"@type":"ListItem","position":2,"name":"Documentation","item":"https:\/\/developer.rdkcentral.com\/documentation\/"},{"@type":"ListItem","position":3,"name":"RDK Entertainment","item":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/"},{"@type":"ListItem","position":4,"name":"Components","item":"https:\/\/developer.rdkcentral.com\/documentation\/documentation\/rdk_video_documentation\/components\/"},{"@type":"ListItem","position":5,"name":"audiocapturemgr"}]},{"@type":"WebSite","@id":"https:\/\/developer.rdkcentral.com\/documentation\/#website","url":"https:\/\/developer.rdkcentral.com\/documentation\/","name":"RDK Documentation Portal | Documentation","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/developer.rdkcentral.com\/documentation\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/9873","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/comments?post=9873"}],"version-history":[{"count":3,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/9873\/revisions"}],"predecessor-version":[{"id":11028,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/9873\/revisions\/11028"}],"up":[{"embeddable":true,"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/pages\/9844"}],"wp:attachment":[{"href":"https:\/\/developer.rdkcentral.com\/documentation\/wp-json\/wp\/v2\/media?parent=9873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}