Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8716011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:58:38+00:00 2026-06-13T05:58:38+00:00

p1 = subprocess.Popen([arecord, -Dhw:1,0, -fS16_LE, -d120, -r44100],stdout=subprocess.PIPE) p2 = subprocess.Popen([lame, -, test/%s/%s %(dirname, filename)],

  • 0
p1 = subprocess.Popen(["arecord", "-Dhw:1,0", "-fS16_LE", "-d120", "-r44100"],stdout=subprocess.PIPE)
p2 = subprocess.Popen(["lame", "-", "test/%s/%s" %(dirname, filename)], stdin=p1.stdout)


output = p2.communicate()[0]

As you see here, I’m recording using arecord directly to mp3.

The problem i’m facing is that I need to upload the files i’m recording but as soon as the recording start it’s generating a file and appending the audio to it rather than generating the mp3 file when the duration of the record is finished. The result is each time it checks for the file, it uploads the chunk of the file that is ready.

I only want the script to upload the file when the file is completed or i want lame to generate me the file when the duration is finish.

How can i check that the file is not in use anymore or maybe make lame use a temporary file then save the completed file to the main directory.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:58:39+00:00Added an answer on June 13, 2026 at 5:58 am

    Why not just wait for the process to complete? Just do the upload after communicate returns.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

import re import subprocess sub = subprocess.Popen(['/home/karthik/Downloads/stanford-parser-2011-06- 08/lexparser.csh'], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr = subprocess.PIPE) sub.stdin.write(i
I am executing the python command, proc = subprocess.Popen(cmd, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, )
myfile = open(wrsu+str(i)+'_'+str(j)+'_'+str(TimesToExec)+.txt,'w') sys.stdout = myfile p1 = subprocess.Popen([pathname,r, s,u,str(i),str(j),str(runTime)],stdout=subprocess.PIPE) output = p1.communicate()[0] print
import os import subprocess proc = subprocess.Popen(['ls','*.bc'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) out,err = proc.communicate() print out
I am using the subprocess module like that: ping = subprocess.Popen('fping.exe 192.168.2.3 196.65.58.69', stdout=PIPE)
Given this : import os import subprocess def check_server(): cl = subprocess.Popen([nmap,10.7.1.71], stdout=subprocess.PIPE) result
Currently I am using this: def _get_mac_ver(): import subprocess p = subprocess.Popen(['sw_vers', '-productVersion'], stdout=subprocess.PIPE)
I have a snippet of code which works: p = subprocess.Popen('psftp servername'.split(),stdin=subprocess.PIPE, tdout=subprocess.PIPE, shell=True)
i've got this snazzy python code: import subprocess value = subprocess.Popen([php,./php/php_runner.php],stdout=subprocess.PIPE); the problem is,
Why its not working? :| import subprocess p = subprocess.Popen([rsnmpget,-v,1,-c,public,-Oqv,,-Ln,192.168.1.1 1.3.6.1.2.1.2.2.1.10.7],stdout=subprocess.PIPE).communicate()[0] print p Run

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.