Play audio directly from Lambda /tmp folder Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!S3 Bucket Policy for hotlinking is preventing writesHow to pass a querystring or route parameter to AWS Lambda from Amazon API GatewayHow to configure aws s3 bucket to accept signed urls on Heroku?Node js - Moving a file from /tmp in Amazon Lambda to an s3bucketClearing out tmp folder from AWS LambdaIssues with JSON.parse on input object form S3 - Node.jsS3 upload from browser with presigned URL and SSE-C - 307 and 403sNodeJS - reading file from S3 to /tmp folder in LambdaPython | Lambda | Decrypt EFS data and send to S3How to access /tmp folder in Lambda with in Node?

How to open locks without disable device?

Protagonist's race is hidden - should I reveal it?

With indentation set to `0em`, when using a line break, there is still an indentation of a size of a space

Implementing 3DES algorithm in Java: is my code secure?

"Whatever a Russian does, they end up making the Kalashnikov gun"? Are there any similar proverbs in English?

Has a Nobel Peace laureate ever been accused of war crimes?

Do I need to protect SFP ports and optics from dust/contaminants? If so, how?

AI positioning circles within an arc at equal distances and heights

Married in secret, can marital status in passport be changed at a later date?

What *exactly* is electrical current, voltage, and resistance?

My admission is revoked after accepting the admission offer

Is Diceware more secure than a long passphrase?

Are these square matrices always diagonalisable?

How to find the right literary agent in the USA?

A strange hotel

What is it called when you ride around on your front wheel?

Did the Roman Empire have Penal Colonies?

How to translate "red flag" into Spanish?

Is there any hidden 'W' sound after 'comment' in : Comment est-elle?

"My boss was furious with me and I have been fired" vs. "My boss was furious with me and I was fired"

All ASCII characters with a given bit count

std::is_constructible on incomplete types

Book with legacy programming code on a space ship that the main character hacks to escape

Could Neutrino technically as side-effect, incentivize centralization of the bitcoin network?



Play audio directly from Lambda /tmp folder



Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar Manara
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!S3 Bucket Policy for hotlinking is preventing writesHow to pass a querystring or route parameter to AWS Lambda from Amazon API GatewayHow to configure aws s3 bucket to accept signed urls on Heroku?Node js - Moving a file from /tmp in Amazon Lambda to an s3bucketClearing out tmp folder from AWS LambdaIssues with JSON.parse on input object form S3 - Node.jsS3 upload from browser with presigned URL and SSE-C - 307 and 403sNodeJS - reading file from S3 to /tmp folder in LambdaPython | Lambda | Decrypt EFS data and send to S3How to access /tmp folder in Lambda with in Node?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I'm currently building a Alexa application in Node with Lambda. I have the need to convert and merge several audio files. I'm currently creating an audio file using google text-to-speech (long story on the need for it) which I write to /tmp and pulling an audio file from s3 which I also write to /tmp. I'm then using sox to merge the two files (see below) and write back to S3 (currently public) which I then have hard coded to play that particular clip.



My question is if it is possible to play audio directly from the /tmp folder as opposed to having to write the file back to S3.



await lambdaAudio.sox('-m /tmp/google-formatted.mp3 /tmp/audio.mp3 /tmp/result.mp3')

// get data from resulting mp3
const data = await readFile('/tmp/result.mp3');
const base64data = new Buffer(data, 'binary');

// put file back on AWS for playing
s3.putObject(
Bucket: 'my-bucket',
Key: 'result.mp3',
Body: base64data,
ACL:'public-read'
,function (resp)
console.log('Done');
);

return`<audio src="https://s3.amazonaws.com/my-bucket/result.mp3" />`;









share|improve this question






























    1















    I'm currently building a Alexa application in Node with Lambda. I have the need to convert and merge several audio files. I'm currently creating an audio file using google text-to-speech (long story on the need for it) which I write to /tmp and pulling an audio file from s3 which I also write to /tmp. I'm then using sox to merge the two files (see below) and write back to S3 (currently public) which I then have hard coded to play that particular clip.



    My question is if it is possible to play audio directly from the /tmp folder as opposed to having to write the file back to S3.



    await lambdaAudio.sox('-m /tmp/google-formatted.mp3 /tmp/audio.mp3 /tmp/result.mp3')

    // get data from resulting mp3
    const data = await readFile('/tmp/result.mp3');
    const base64data = new Buffer(data, 'binary');

    // put file back on AWS for playing
    s3.putObject(
    Bucket: 'my-bucket',
    Key: 'result.mp3',
    Body: base64data,
    ACL:'public-read'
    ,function (resp)
    console.log('Done');
    );

    return`<audio src="https://s3.amazonaws.com/my-bucket/result.mp3" />`;









    share|improve this question


























      1












      1








      1








      I'm currently building a Alexa application in Node with Lambda. I have the need to convert and merge several audio files. I'm currently creating an audio file using google text-to-speech (long story on the need for it) which I write to /tmp and pulling an audio file from s3 which I also write to /tmp. I'm then using sox to merge the two files (see below) and write back to S3 (currently public) which I then have hard coded to play that particular clip.



      My question is if it is possible to play audio directly from the /tmp folder as opposed to having to write the file back to S3.



      await lambdaAudio.sox('-m /tmp/google-formatted.mp3 /tmp/audio.mp3 /tmp/result.mp3')

      // get data from resulting mp3
      const data = await readFile('/tmp/result.mp3');
      const base64data = new Buffer(data, 'binary');

      // put file back on AWS for playing
      s3.putObject(
      Bucket: 'my-bucket',
      Key: 'result.mp3',
      Body: base64data,
      ACL:'public-read'
      ,function (resp)
      console.log('Done');
      );

      return`<audio src="https://s3.amazonaws.com/my-bucket/result.mp3" />`;









      share|improve this question
















      I'm currently building a Alexa application in Node with Lambda. I have the need to convert and merge several audio files. I'm currently creating an audio file using google text-to-speech (long story on the need for it) which I write to /tmp and pulling an audio file from s3 which I also write to /tmp. I'm then using sox to merge the two files (see below) and write back to S3 (currently public) which I then have hard coded to play that particular clip.



      My question is if it is possible to play audio directly from the /tmp folder as opposed to having to write the file back to S3.



      await lambdaAudio.sox('-m /tmp/google-formatted.mp3 /tmp/audio.mp3 /tmp/result.mp3')

      // get data from resulting mp3
      const data = await readFile('/tmp/result.mp3');
      const base64data = new Buffer(data, 'binary');

      // put file back on AWS for playing
      s3.putObject(
      Bucket: 'my-bucket',
      Key: 'result.mp3',
      Body: base64data,
      ACL:'public-read'
      ,function (resp)
      console.log('Done');
      );

      return`<audio src="https://s3.amazonaws.com/my-bucket/result.mp3" />`;






      node.js amazon-s3 aws-lambda alexa






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 23 at 8:20









      John Rotenstein

      80k791143




      80k791143










      asked Mar 22 at 15:49









      eric MCeric MC

      4362530




      4362530






















          1 Answer
          1






          active

          oldest

          votes


















          0














          I usually upload the lambda function zipping the code and modules and in general all the files that my code requires.
          https://developer.amazon.com/blogs/post/Tx1UE9W1NQ0GYII/Publishing-Your-Skill-Code-to-Lambda-via-the-Command-Line-Interface
          So if you zip the /tmp directory and publish it as part of your lambda code the audio file will be accessible by your lambda function






          share|improve this answer























          • unfortunately this audio dialog needs to be created on the fly, writing to the /tmp folder then read so uploading it isn't an option.

            – eric MC
            Mar 25 at 16:17











          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55303357%2fplay-audio-directly-from-lambda-tmp-folder%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          I usually upload the lambda function zipping the code and modules and in general all the files that my code requires.
          https://developer.amazon.com/blogs/post/Tx1UE9W1NQ0GYII/Publishing-Your-Skill-Code-to-Lambda-via-the-Command-Line-Interface
          So if you zip the /tmp directory and publish it as part of your lambda code the audio file will be accessible by your lambda function






          share|improve this answer























          • unfortunately this audio dialog needs to be created on the fly, writing to the /tmp folder then read so uploading it isn't an option.

            – eric MC
            Mar 25 at 16:17















          0














          I usually upload the lambda function zipping the code and modules and in general all the files that my code requires.
          https://developer.amazon.com/blogs/post/Tx1UE9W1NQ0GYII/Publishing-Your-Skill-Code-to-Lambda-via-the-Command-Line-Interface
          So if you zip the /tmp directory and publish it as part of your lambda code the audio file will be accessible by your lambda function






          share|improve this answer























          • unfortunately this audio dialog needs to be created on the fly, writing to the /tmp folder then read so uploading it isn't an option.

            – eric MC
            Mar 25 at 16:17













          0












          0








          0







          I usually upload the lambda function zipping the code and modules and in general all the files that my code requires.
          https://developer.amazon.com/blogs/post/Tx1UE9W1NQ0GYII/Publishing-Your-Skill-Code-to-Lambda-via-the-Command-Line-Interface
          So if you zip the /tmp directory and publish it as part of your lambda code the audio file will be accessible by your lambda function






          share|improve this answer













          I usually upload the lambda function zipping the code and modules and in general all the files that my code requires.
          https://developer.amazon.com/blogs/post/Tx1UE9W1NQ0GYII/Publishing-Your-Skill-Code-to-Lambda-via-the-Command-Line-Interface
          So if you zip the /tmp directory and publish it as part of your lambda code the audio file will be accessible by your lambda function







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 23 at 8:10









          Ester Gonzalez De LangaricaEster Gonzalez De Langarica

          1298




          1298












          • unfortunately this audio dialog needs to be created on the fly, writing to the /tmp folder then read so uploading it isn't an option.

            – eric MC
            Mar 25 at 16:17

















          • unfortunately this audio dialog needs to be created on the fly, writing to the /tmp folder then read so uploading it isn't an option.

            – eric MC
            Mar 25 at 16:17
















          unfortunately this audio dialog needs to be created on the fly, writing to the /tmp folder then read so uploading it isn't an option.

          – eric MC
          Mar 25 at 16:17





          unfortunately this audio dialog needs to be created on the fly, writing to the /tmp folder then read so uploading it isn't an option.

          – eric MC
          Mar 25 at 16:17



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55303357%2fplay-audio-directly-from-lambda-tmp-folder%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해