Tajriba ishi 5


Download 12.25 Kb.
Sana05.01.2022
Hajmi12.25 Kb.
#218822
Bog'liq
5-ish (2)


Tajriba ishi 5

Elektron hujjatlarni saqlash Elektron hujjatlar elektron hujjat aylanishi ishtirokchilari tomonidan qonun hujjatlarida belgilangan tartibda saqlanishi kerak. Elektron hujjatlarni saqlash chog‘ida ulardan erkin foydalanish va ularning qog‘oz nusxalarini taqdim etish imkoniyati ta’minlanishi lozim. Elektron hujjatni saqlash muddati, agar qonun hujjatlarida boshqacha qoida nazarda tutilmagan bo‘lsa, shunga o‘xshash maqsadga mo‘ljallangan qog‘oz hujjat uchun belgilangan muddatdan kam bo‘lmasligi kerak.

import pyaudio

p = pyaudio.PyAudio()

for i in range(p.get_device_count()):

print (i, p.get_device_info_by_index(i)['name'])

import wave

CHUNK = 1024

FORMAT = pyaudio.paInt16

CHANNELS = 2

RATE = 44100

RECORD_SECONDS = 5

WAVE_OUTPUT_FILENAME = "output.wav"

p = pyaudio.PyAudio()

stream = p.open(format=FORMAT,

channels=CHANNELS,

rate=RATE,

input=True,

input_device_index=2,

frames_per_buffer=CHUNK)

print("* recording")

frames = []

for i in range(0, int(RATE / CHUNK * RECORD_SECONDS)):

data = stream.read(CHUNK)

frames.append(data)

print("* done recording")

stream.stop_stream()

stream.close()

p.terminate()

wf = wave.open(WAVE_OUTPUT_FILENAME, 'wb')

wf.setnchannels(CHANNELS)

wf.setsampwidth(p.get_sample_size(FORMAT))

wf.setframerate(RATE)

wf.writeframes(b''.join(frames))



wf.close()
Download 12.25 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling