Jump to content

Retro

Members
  • Posts

    20
  • Joined

  • Last visited

Posts posted by Retro

  1. Am reusit sa salveze inregistrarile la fiecare minut, insa nu stiu cum sa setez sample rate-ul:

     

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Runtime.InteropServices;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using Microsoft.Win32;
    using Timer = System.Timers.Timer;
    
    namespace SystemCheck
    {
        public partial class MainForm : Form
        {
            [DllImport("winmm.dll", EntryPoint = "mciSendStringA", ExactSpelling = true, CharSet = CharSet.Ansi, SetLastError = true)]
            private static extern int record(string lpstrCommand, string lpstrReturnString, int uReturnLength, int hwndCallback);
    
            public MainForm()
            {
                InitializeComponent();
    
                this.ShowInTaskbar = false; //hide the app from taskbar
    
                recordFunction(); //start the record function
    
                System.Windows.Forms.Timer t = new System.Windows.Forms.Timer(); //create a timer
                t.Interval = 60000; // specify interval time as you want
                t.Tick += new EventHandler(timer_Tick); //
                t.Start(); //start the timer
            }
    
            void timer_Tick(object sender, EventArgs e)
            {
                saveFunction();
                recordFunction();
            }
    
            public void recordFunction()
            {
                record("open new Type waveaudio Alias recsound", "", 0, 0);
                record("record recsound", "", 0, 0);
            }
    
            public void saveFunction()
            {
                string location = @"d:\\temp\" + DateTime.Now.ToString("ddMMyy") + @"\";
                bool folderExists = System.IO.Directory.Exists(location);
                if (!folderExists)
                    System.IO.Directory.CreateDirectory(location);
                string date = DateTime.Now.ToString("hh.mm.ss");
                string txt = "save recsound " + location + date + ".wav";
                record(txt, "", 0, 0);
                record("close recsound", "", 0, 0);
            }
        }
    }

     

    Daca imi poti da un "tip" pentru sample rate ti-as ramane foarte recunoscator, chiar si asa iti multumesc pentru ajutor! :)

  2. Am incercat cu NAudio, dar primeam urmatoarea eroare de fiecare data cand voiam sa rulez aplicatia: "Visual Studio cannot start debugging because the debug target 'C:\\...desktop\NAudio-master\NAudioDemo\bin\Debug\NAudioDemo.exe' is missing. Please build the project and retry, or set the OutputPath and AssemblyName properties appropriately to point at the correct location for the target assembly". Am incercat si cu Build -> Build solution si Build -> Rebuild solution dar fara succes.

     

    Am gasit tutorialul acesta: http://www.c-sharpcorner.com/blogs/audio-recorder-in-c-sharp1, am pus in practica acel cod si functioneaza, desi imi da impresia ca inregistrarile sunt slab calitative. Singura chestie ce ma impiedica acum este: cum pot face ca atunci cand programul se inchide fortat (se da shutdown la calculator in timp ce programul este inca activ) sa se salveze automat inregistrarea, sa nu fi nevoit sa apesi butonul STOP?

  3. Vreau ca de fiecare data cand imi porneste calculatorul sa inceapa si inregistrarea audio. Am gasit un tutorial pentru Windows 7 aici: https://superuser.com/questions/837550/how-to-hide-sound-recorder-in-windows-7 . Eu am Windows 10, si cmd-ul nu imi recunoaste comanda soundrecorder, asa ca am mai cautat si am gasit asta: https://superuser.com/questions/1154793/how-to-start-windows-voice-recorder-from-the-cmd.

     

    Punand cele doua solutii cap la cap, rezulta comanda asta: "explorer.exe shell:appsFolder\Microsoft.WindowsSoundRecorder_8wekyb3d8bbwe!App /FILE c:\temp\output_%date%_%random%.wav /DURATION 0:0:10" insa tot ce primesc este sa fie deschis folder-ul Documents. 

     

    Ma poate ajuta cineva cu o alternativa sau o solutie? Multumesc! :D

  4. Va salut!

     

    De ceva timp ma gandesc sa iau un curs de C#, am ceva cunostinte din liceu, insa am ramas tot acolo, nu le-am mai dezvoltat, si a fost un limbaj de programare de care m-am bucurat foarte mult. Sunt mai mult interesat de Windows Forms, si nu de programarea in consola. Mai jos sunt cateva imagini cu ultimul proiect:

     

    StcUtEV.png

    GQ0L0yb.png

    6xLoAeL.png

     

    Tocmai ce am intrat pe Udemy si am vazut oferta lor "Learn it first / Keep your competitive edge with courses for only £12 / 3 days left!". Ce parere aveti de urmatoarele cursuri? Credeti ca primul este suficient sau este mai indicat sa cumpar "pachetul" al doilea? Astept recomandarile voastre. Multumesc!

     

     

    Quote

     

    Quote

     

     

×
×
  • Create New...