order

Gujarat HC orders release of SW South Wind I after pact with exporting firm

Two more arrest orders are pending against the vessel




order

Indian Railways renegotiates Vande Bharat order to 80 high-capacity trainsets; JV Kinet on-board

New order consists of 80 trainsets with a 24-coach configuration, instead of originally planned 16




order

RITES reports 25% decline in Q2 net profit, sees stable order book

RITES has declared a second interim dividend of ₹1.75 per equity share.




order

Curtains for Jet Airways as Supreme Court orders liquidation

A three member bench of the apex court invoked its powers under Article 142 of the constitution and directed the liquidation of the grounded airline.




order

Recaro to commence India sourcing to support mega orders; IndiGo among major clients

Recaro, the global aircraft seat manufacturer, has bagged mega orders from India-based airlines, including IndiGo




order

Sequence-dependent Conformational Transitions of Disordered Proteins During Condensation

Chem. Sci., 2024, Accepted Manuscript
DOI: 10.1039/D4SC05004E, Edge Article
Open Access
Jiahui Wang, Dinesh Devarajan, Keerthivasan Muthukumar, Youngchan Kim, Arash Nikoubashman, Jeetain Mittal
Intrinsically disordered proteins (IDPs) can form biomolecular condensates through phase separation. It is recognized that the conformation of IDPs in the dense and dilute phases, as well as at the...
The content of this RSS Feed (c) The Royal Society of Chemistry




order

HC holds that civil courts have jurisdiction to order execution of decree on Waqf disputes

Petitioners challenge a civil court’s dismissal of a petition filed by them seeking to execute the decree that was passed before the commencement of the Waqf Act. HC asks munsiff court to proceed with the execution petition and pass an order in three months




order

No merger of 50% DA into basic, as finance ministry issues order payment for 53% DA

DA to central government employees was enhanced from 50 per cent to 53 per cent of the basic pay with effect from July 1, 2024




order

What is Seasonal Affective Disorder? Why it happens in winter?

Common SAD symptoms include hopelessness, loss of interest in daily activities, fatigue, trouble focusing, and changes in sleep and appetite.




order

Home Minister Amit Shah aware of deteriorating law and order situation in Andhra Pradesh: BJP MP

If A.P. CM was really concerned about what happened, he should step down by owning moral responsibility, the BJP MP said




order

The missing daughters of Odisha’s border villages

The Crime in India 2022 report, released by the National Crime Record Bureau says 1,120 persons were trafficked from Odisha during the year 2022, the highest in the country; Lulkidhi village has many such girls, whose family laments their loss




order

President-elect Trump to appoint former ICE director Tom Homan as U.S. 'border czar'

Mr. Homan, who served in the Trump administration for a year and a half during his first term, is also a contender for secretary of homeland security




order

Court orders community service for 28-year-old youth in theft case

The verdict is claimed to be the first-of-its-kind in Andhra Pradesh after the implementation of the Bharatiya Nyaya Sanhita (BNS) and Bharatiya Suraksha Sanhita (BNSS) laws




order

Pawan Kalyan orders probe into land acquisition for Saraswati Power Project in Palnadu district of Andhra pradesh

Deputy Chief Minister says farmers belonging to the Scheduled Castes were forced to give up their lands under pressure and alleged threats for a non-existent factory




order

Discrimination of Diptera order insects based on their saturated cuticular hydrocarbon content using a new microextraction procedure and chromatographic analysis

Anal. Methods, 2024, Accepted Manuscript
DOI: 10.1039/D4AY00214H, Paper
Open Access
Lixy Olinda León-Morán, Marta Pastor-Belda, Pilar Viñas, Natalia Arroyo-Manzanares, María Dolores García, María Isabel Arnaldos, Natalia Campillo
The nature and proportions of hydrocarbons in the cuticle of insects is characteristic of the species and age. Chemical analysis of cuticular hydrocarbons allows species discrimination, which is of great...
The content of this RSS Feed (c) The Royal Society of Chemistry




order

​For a fair probe: On the Kejriwal bail order and CBI conduct

Kejriwal bail order is a reminder to CBI to dispel perception of bias




order

​Over the borderline: On the India-China deal 

The agreement between India and China opens new opportunities  




order

Development, biological evaluation, and molecular modelling of some benzene-sulfonamide derivatives as protein tyrosine phosphatase-1B inhibitors for managing diabetes mellitus and associated metabolic disorders

RSC Med. Chem., 2024, Advance Article
DOI: 10.1039/D4MD00594E, Research Article
Nagat Ghareb, Khaled M. Darwish, Mohamed S. Nafie, Ranwa Elrayess, Noha M. Abourobe, Shaimaa A. Fattah, Reem M. Hazem, Eman T. Mehanna, Ranza Elrayess
One benzene-sulfonamide derivative exhibited potent protein tyrosine phosphatase-1B inhibition for managing diabetes mellitus and associated metabolic disorders.
To cite this article before page numbers are assigned, use the DOI form of citation above.
The content of this RSS Feed (c) The Royal Society of Chemistry




order

AAP attacks Centre over ‘worsening’ law and order situation




order

Border checkposts in Nilgiris to soon have automatic number plate recognition cameras

This comes in the wake of the Madras High Court recently expressing dissatisfaction over the implementation of the e-pass system in the Nilgiris and Kodaikanal




order

The cellular Potts model on disordered lattices

Soft Matter, 2024, 20,8337-8352
DOI: 10.1039/D4SM00445K, Paper
Open Access
  This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.
Hossein Nemati, J. de Graaf
Extending the cellular Potts model to disordered Voronoi lattices reduces artifacts observed on regular lattices. An order–disorder transition is observed as a function of surface tension on the disordered lattice and the regular lattices.
The content of this RSS Feed (c) The Royal Society of Chemistry




order

Rolling and ordering of micro rods in shear flow induced by rod wall interactions

Soft Matter, 2024, Advance Article
DOI: 10.1039/D4SM00999A, Paper
Open Access
  This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.
Martin Wittmann, Igor M. Kulić, Antonio Stocco, Juliane Simmchen
We use experiments and theoretical models to investigate the rolling and translational motion of rod-shaped micro particles close to a solid wall in the presence or absence of shear flow.
To cite this article before page numbers are assigned, use the DOI form of citation above.
The content of this RSS Feed (c) The Royal Society of Chemistry




order

Solvent-Free Confinement of Ordered Microparticle Monolayers: Effect of Host Substrate and Pattern Symmetry

Soft Matter, 2024, Accepted Manuscript
DOI: 10.1039/D4SM01196A, Paper
Open Access
  This article is licensed under a Creative Commons Attribution 3.0 Unported Licence.
Ignaas Jimidar, Mitch de Waard, Gijs Roozendaal, Kai Sotthewes
The self-organisation of individual suspended colloids into ordered structures that can be mediated by confinement has garnered interest recently. Despite the push for solvent reduction for sustainability reasons, the comprehension...
The content of this RSS Feed (c) The Royal Society of Chemistry




order

Building a Dictaphone Using Media Recorder and getUserMedia

Chris Mills brushes up his shorthand and shows how the MediaStream Recording API in modern browsers can be used to capture audio directly from the user’s device. Inching ever closer to the capabilities of native software, it truly is an exciting time to be a web developer.


The MediaStream Recording API makes it easy to record audio and/or video streams. When used with MediaDevices.getUserMedia(), it provides an easy way to record media from the user’s input devices and instantly use the result in web apps. This article shows how to use these technologies to create a fun dictaphone app.

A sample application: Web Dictaphone

To demonstrate basic usage of the MediaRecorder API, we have built a web-based dictaphone. It allows you to record snippets of audio and then play them back. It even gives you a visualisation of your device’s sound input, using the Web Audio API. We’ll just concentrate on the recording and playback functionality in this article, for brevity’s sake.

You can see this demo running live, or grab the source code on GitHub. This has pretty good support on modern desktop browsers, but pretty patchy support on mobile browsers currently.

Basic app setup

To grab the media stream we want to capture, we use getUserMedia(). We then use the MediaRecorder API to record the stream, and output each recorded snippet into the source of a generated <audio> element so it can be played back.

We’ll first declare some variables for the record and stop buttons, and the <article> that will contain the generated audio players:

const record = document.querySelector('.record');
const stop = document.querySelector('.stop');
const soundClips = document.querySelector('.sound-clips');

Next, we set up the basic getUserMedia structure:

if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {
   console.log('getUserMedia supported.');
   navigator.mediaDevices.getUserMedia (
      // constraints - only audio needed for this app
      {
         audio: true
      })

      // Success callback
      .then(function(stream) {

      })

      // Error callback
      .catch(function(err) {
         console.log('The following `getUserMedia` error occured: ' + err);
      }
   );
} else {
   console.log('getUserMedia not supported on your browser!');
}

The whole thing is wrapped in a test that checks whether getUserMedia is supported before running anything else. Next, we call getUserMedia() and inside it define:

  • The constraints: Only audio is to be captured for our dictaphone.
  • The success callback: This code is run once the getUserMedia call has been completed successfully.
  • The error/failure callback: The code is run if the getUserMedia call fails for whatever reason.

Note: All of the code below is found inside the getUserMedia success callback in the finished version.

Capturing the media stream

Once getUserMedia has created a media stream successfully, you create a new Media Recorder instance with the MediaRecorder() constructor and pass it the stream directly. This is your entry point into using the MediaRecorder API — the stream is now ready to be captured into a <Blob>, in the default encoding format of your browser.

const mediaRecorder = new MediaRecorder(stream);

There are a series of methods available in the MediaRecorder interface that allow you to control recording of the media stream; in Web Dictaphone we just make use of two, and listen to some events. First of all, MediaRecorder.start() is used to start recording the stream once the record button is pressed:

record.onclick = function() {
  mediaRecorder.start();
  console.log(mediaRecorder.state);
  console.log("recorder started");
  record.style.background = "red";
  record.style.color = "black";
}

When the MediaRecorder is recording, the MediaRecorder.state property will return a value of “recording”.

As recording progresses, we need to collect the audio data. We register an event handler to do this using mediaRecorder.ondataavailable:

let chunks = [];

mediaRecorder.ondataavailable = function(e) {
  chunks.push(e.data);
}

Last, we use the MediaRecorder.stop() method to stop the recording when the stop button is pressed, and finalize the Blob ready for use somewhere else in our application.

stop.onclick = function() {
  mediaRecorder.stop();
  console.log(mediaRecorder.state);
  console.log("recorder stopped");
  record.style.background = "";
  record.style.color = "";
}

Note that the recording may also stop naturally if the media stream ends (e.g. if you were grabbing a song track and the track ended, or the user stopped sharing their microphone).

Grabbing and using the blob

When recording has stopped, the state property returns a value of “inactive”, and a stop event is fired. We register an event handler for this using mediaRecorder.onstop, and construct our blob there from all the chunks we have received:

mediaRecorder.onstop = function(e) {
  console.log("recorder stopped");

  const clipName = prompt('Enter a name for your sound clip');

  const clipContainer = document.createElement('article');
  const clipLabel = document.createElement('p');
  const audio = document.createElement('audio');
  const deleteButton = document.createElement('button');

  clipContainer.classList.add('clip');
  audio.setAttribute('controls', '');
  deleteButton.innerHTML = "Delete";
  clipLabel.innerHTML = clipName;

  clipContainer.appendChild(audio);
  clipContainer.appendChild(clipLabel);
  clipContainer.appendChild(deleteButton);
  soundClips.appendChild(clipContainer);

  const blob = new Blob(chunks, { 'type' : 'audio/ogg; codecs=opus' });
  chunks = [];
  const audioURL = window.URL.createObjectURL(blob);
  audio.src = audioURL;

  deleteButton.onclick = function(e) {
    let evtTgt = e.target;
    evtTgt.parentNode.parentNode.removeChild(evtTgt.parentNode);
  }
}

Let’s go through the above code and look at what’s happening.

First, we display a prompt asking the user to name their clip.

Next, we create an HTML structure like the following, inserting it into our clip container, which is an <article> element.

<article class="clip">
  <audio controls></audio>
  <p>_your clip name_</p>
  <button>Delete</button>
</article>

After that, we create a combined Blob out of the recorded audio chunks, and create an object URL pointing to it, using window.URL.createObjectURL(blob). We then set the value of the <audio> element’s src attribute to the object URL, so that when the play button is pressed on the audio player, it will play the Blob.

Finally, we set an onclick handler on the delete button to be a function that deletes the whole clip HTML structure.

So that’s basically it — we have a rough and ready dictaphone. Have fun recording those Christmas jingles! As a reminder, you can find the source code, and see it running live, on the MDN GitHub.


This article is based on Using the MediaStream Recording API by Mozilla Contributors, and is licensed under CC-BY-SA 2.5.


About the author

Chris Mills manages the MDN web docs writers’ team at Mozilla, which involves spreadsheets, meetings, writing docs and demos about open web technologies, and occasional tech talks at conferences and universities. He used to work for Opera and W3C, and enjoys playing heavy metal drums and drinking good beer.

More articles by Chris




order

Just what your trainer ordered

Healthy meal delivery services now have trainers and nutritionists on board to give clients the best of pre and post-workout food, writes SUSANNA MYRTLE LAZARUS




order

Topics : Fetal Alcohol Spectrum Disorder / directed by: Nettie Wild ; production agencies: National Film Board of Canada (Montreal), British Columbia Centre for Disease Control. Street Nurse Program (Vancouver)

Montreal : National Film Board of Canada, 2019




order

IG orders departmental inquiry into ‘preferential treatment’ to Borugadda Anil Kumar

The events came to light after a video clip went viral on social media on Saturday, in which police can be seen offering him a table, bed sheet and allowing him to sleep outside the lock up, but within the station




order

Ordered sets [electronic resource] / by Egbert Harzheim

New York : Springer, 2005




order

Higher education students of madrassas face uncertain future after Supreme Court order

The Madrasa Board proposed to the government to accommodate the students of its Kamil and Fazil courses, but no decision was taken on it; about 25,000 students are studying in the Kamil and Fazil courses currently




order

RPL stock case: SC dismisses SEBI's appeal against SAT order giving relief to Mukesh Ambani




order

India cancel intra-squad match to prioritise net practice ahead of Border-Gavaskar Trophy

India cancels intra-squad match with ‘A’ side in Australia tour for more net practice, focusing on Test series preparation




order

Border-Gavaskar trophy: Captain Rohit Sharma doubtful for Perth Test

Rohit along with a large India squad will depart for Perth in two batches – on November 10 and 11 – and the captain may come back home for a while due to personal reasons.




order

India’s coaching staff under the scanner ahead of the Border-Gavaskar series

Gambhir & Co. gets captain Rohit’s backing after the home Test series loss against New Zealand; the head coach says the team has to be honest and keep working hard




order

Australian pacer Boland looks to keep KL Rahul under pressure ahead of Border-Gavaskar Trophy

Rahul made a hundred on his debut tour to Australia in 2015, a 110 at Sydney, but his overall performance Down Under remains scratchy, evidenced by an average of 20.77 across four Tests.




order

Border-Gavaskar Trophy: Marcus Harris thrusts himself into pole position in Australia ‘bat-off’

The diminutive 32-year-old steered Australia A to 223 in reply to India A’s 161 on day two of their four-day match at the Melbourne Cricket Ground — seen as a bat-off for the Test spot left vacant by David Warner’s retirement.




order

Madhya Pradesh Government orders colleges to buy set of 88 books, most of which are written by authors with links to RSS

Colleges have also been asked to set up ‘Bharatiya gyaan parampara’ cells




order

Farmers to hold maha panchayat on September 15 and 22, ask center to open borders to Delhi




order

Minor raped by teacher in Bhopal school; CM orders formation of special court

The alleged incident took place inside the private school in Kamla Nagar police station area on September 13 and the girl’s mother reported it to the police the next day




order

PIX: India's top order collapse again; NZ in control

IMAGES from the Day 1 of the third Test played between India and New Zealand at the Wankhede Stadium in Mumbai on Friday




order

Autism Spectrum Disorder: When emotional support should be part of pedagogy

Navigating the challenges of autism in Indian schools: parents share experiences and experts emphasize the need for inclusive education.




order

Fight over including carbon border tax in agenda delays climate talks on day one

Agenda disputes are common at UN climate conferences but this one is especially significant as countries have limited time to agree on a new climate finance goal.




order

Indian, Chinese troops exchange sweets at several border points on Diwali

The ties between the two Asian giants had nosedived following the clash




order

Boozers beware: Maharashtra orders sophisticated surveillance of 'watering holes'




order

IND vs SA second T20I: India needs top-order to bat better against South Africa

India need to address lack of runs from other key batters to ensure that the burden doesn't fall too heavily on their in-form keeper-batter.




order

Border-Gavaskar Trophy: Perth pitch to have really good pace and bounce: Curator cautions India ahead of first Test

India will focus on centre-wicket training at the nearby WACA stadium, where Australia will also polish their skills




order

Border-Gavaskar Trophy: Australian opener McSweeney braces for "unique" Bumrah challenge

McSweeney was drafted into the Australia squad after a slew of impressive performances in the Sheffield Shield tournament and in the recent ‘A’ series against India




order

Border-Gavaskar trophy: Tim Paine backs Dhruv Jurel to play in Test series against Australia

Paine, who coached Australia A in the recent series against India A, witnessed Jurel's exploits in the second 'unofficial' Test where the 23-year-old scored an 80 and 68 at Melbourne.




order

CCI publishes detailed order approving merger of RIL, Walt Disney's media assets

As part of seeking the regulator’s approval, the parties have voluntarily agreed that they will not bundle TV ad slots for IPL, ICC and BCCI cricketing rights till the end of existing rights




order

Ashok Leyland arm bags 500 e-buses order from Chennai MTC

Ashok Leyland’s subsidiaries Switch Mobility will supply the buses while OHM will operate and maintain them.




order

L&T bags 'significant' order for global nuclear fusion project

The company classifies a 'significant order' as orders valued between ₹1,000 crore and ₹2,500 crore