Skip to content

Instantly share code, notes, and snippets.

View rashaabdulrazzak's full-sized avatar
🎯
Focusing

Rasha rashaabdulrazzak

🎯
Focusing
View GitHub Profile

‫ الكتابة بالعربي Arabic

الكتابة بالعربي Arabic
@rashaabdulrazzak
rashaabdulrazzak / localfile.js
Last active May 29, 2021 08:49
local file transcript
// require fs to be able to read the file
const fs = require('fs')
// define the path where the file located
const filename = './resources/test.wav'
// the changes below should inclouded inside quickstart function
// read the file
const file = fs.readFileSync(filename)
// convert it to base 64
const audioBytes = file.toString('base64')
@rashaabdulrazzak
rashaabdulrazzak / longfiletranscribe.js
Last active January 9, 2023 16:25
transcribe file located in cloud
// Imports the Google Cloud client library
const speech = require('@google-cloud/speech');
// Creates a client
const client = new speech.SpeechClient();
// const gcsUri = 'gs://my-bucket/audio.raw';
// const encoding = 'Encoding of the audio file, e.g. LINEAR16';
// const sampleRateHertz = 16000;
// const languageCode = 'BCP-47 language code, e.g. en-US';
const config = {
encoding: 'LINEAR16',
sampleRateHertz: 44100,
languageCode: 'tr-TR', // For turkish language
audioChannelCount: 2, // Number of audio channel
enableSeparateRecognitionPerChannel: flase, // to not get the result of each channel separately
};
@rashaabdulrazzak
rashaabdulrazzak / turkishLongFile.js
Last active May 29, 2021 09:39
Turkish Long File
// Imports the Google Cloud client library
const speech = require("@google-cloud/speech");
const fs = require('fs')
// Creates a client
const client = new speech.SpeechClient();
async function main() {
const gcsUri = 'gs://aksiontest/one-turkish.wav';
const encoding = 'LINEAR16';
const sampleRateHertz = 44100;
@rashaabdulrazzak
rashaabdulrazzak / vars.rs
Created January 6, 2022 14:23
variable rust
let a:i32 = 5;
let b = 6
@rashaabdulrazzak
rashaabdulrazzak / mutvars.rs
Created January 6, 2022 14:27
variables in rust
let mut a : i32 = 5;
@rashaabdulrazzak
rashaabdulrazzak / print.rs
Created January 7, 2022 11:29
print in rust
fn main (){
let x = 1
println!(" value of X{}", x);
println!("{}{}", 2, 2);
// single placeholder
println!("Number: {}", 1);
// multiple placeholders
println!("{} is a {} language", "Rust", "programing");
@rashaabdulrazzak
rashaabdulrazzak / ifcondition.rs
Created January 7, 2022 12:01
condition in rust
fn main (){
let x = 1 ;
if x == 1 {
println!( "value matched" );
} else {
println!( "value not matched" );
}
}